[Router] use call_id instead of id for matching function calls in Responses API for Harmony (#13056)

This commit is contained in:
Ziwen Zhao
2025-11-11 17:16:47 -08:00
committed by GitHub
parent 0d4a418424
commit 7b877ab83d
2 changed files with 6 additions and 6 deletions

View File

@@ -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))?;

View File

@@ -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 {