From 7b877ab83d87ceee3b02a276521fd915af286b39 Mon Sep 17 00:00:00 2001 From: Ziwen Zhao Date: Tue, 11 Nov 2025 17:16:47 -0800 Subject: [PATCH] [Router] use call_id instead of id for matching function calls in Responses API for Harmony (#13056) --- sgl-router/src/routers/grpc/harmony/builder.rs | 10 +++++----- sgl-router/src/routers/grpc/harmony/responses.rs | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sgl-router/src/routers/grpc/harmony/builder.rs b/sgl-router/src/routers/grpc/harmony/builder.rs index 734e3168e..378242222 100644 --- a/sgl-router/src/routers/grpc/harmony/builder.rs +++ b/sgl-router/src/routers/grpc/harmony/builder.rs @@ -603,11 +603,11 @@ impl HarmonyBuilder { .iter() .rev() .find_map(|item| match item { - ResponseInputOutputItem::FunctionToolCall { id, name, .. } - if id == call_id => - { - Some(name.clone()) - } + ResponseInputOutputItem::FunctionToolCall { + call_id: item_call_id, + name, + .. + } if item_call_id == call_id => Some(name.clone()), _ => None, }) .ok_or_else(|| format!("No function call found for call_id: {}", call_id))?; diff --git a/sgl-router/src/routers/grpc/harmony/responses.rs b/sgl-router/src/routers/grpc/harmony/responses.rs index ae0aaf2de..4d87f04ea 100644 --- a/sgl-router/src/routers/grpc/harmony/responses.rs +++ b/sgl-router/src/routers/grpc/harmony/responses.rs @@ -1353,7 +1353,7 @@ fn build_next_request_with_tools( .. }) = items .iter_mut() - .find(|item| matches!(item, ResponseInputOutputItem::FunctionToolCall { id, .. } if id == &tool_result.call_id)) + .find(|item| matches!(item, ResponseInputOutputItem::FunctionToolCall { call_id, .. } if call_id == &tool_result.call_id)) { *output = Some(output_str); *status = if tool_result.is_error {