use stable item IDs for Responses API calls

This commit is contained in:
Owen Lin
2026-06-08 15:21:01 -07:00
parent 381f0de531
commit 7b2fb1a6f4
55 changed files with 1415 additions and 409 deletions
@@ -83,6 +83,7 @@ fn recent_image_fallback_selects_newest_images_in_chronological_order() {
call_id: "mcp-call".to_string(),
},
ResponseItem::FunctionCallOutput {
id: None,
call_id: "mcp-call".to_string(),
output: image_output("mcp"),
},
@@ -94,6 +95,7 @@ fn recent_image_fallback_selects_newest_images_in_chronological_order() {
input: String::new(),
},
ResponseItem::CustomToolCallOutput {
id: None,
call_id: "code-mode-call".to_string(),
name: Some("exec".to_string()),
output: image_output("code-mode"),
@@ -105,6 +107,7 @@ fn recent_image_fallback_selects_newest_images_in_chronological_order() {
result: "generated".to_string(),
},
ResponseItem::FunctionCallOutput {
id: None,
call_id: "orphan-call".to_string(),
output: image_output("orphan"),
},
+3 -3
View File
@@ -248,9 +248,9 @@ fn recent_images(history: &[ResponseItem], count: usize) -> Vec<ImageUrl> {
ContentItem::InputText { .. } | ContentItem::OutputText { .. } => None,
}));
}
ResponseItem::FunctionCallOutput { call_id, output }
if function_call_ids.contains(call_id.as_str()) =>
{
ResponseItem::FunctionCallOutput {
call_id, output, ..
} if function_call_ids.contains(call_id.as_str()) => {
image_urls.extend(output_image_urls(output));
}
ResponseItem::CustomToolCallOutput {