fix(sse): preserve custom tool output images (#7540)

* fix(sse): preserve custom tool output images

* docs: add changelog for custom tool images

---------

Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
This commit is contained in:
Rafli Surya Wijaya
2026-07-19 08:19:46 +08:00
committed by GitHub
parent 9544fb6353
commit b5134f0b18
2 changed files with 17 additions and 0 deletions

View File

@@ -0,0 +1 @@
- **fix(sse):** preserve `input_image` parts in array-valued Codex `custom_tool_call_output` payloads instead of rewriting them to invalid `output_text` parts ([#7540](https://github.com/diegosouzapw/OmniRoute/pull/7540)) - thanks @loulanyue

View File

@@ -194,3 +194,19 @@ test("normalizes function_call_output image output parts to input_image", () =>
});
assert.equal(JSON.stringify(result).includes('"type":"image_url"'), false);
});
test("preserves custom_tool_call_output input content parts", () => {
const items = [
{
type: "custom_tool_call_output",
call_id: "call_2",
output: [
{ type: "input_text", text: "image tool output" },
{ type: "input_image", image_url: "data:image/png;base64,AAAA" },
],
},
];
const result = sanitizeResponsesInputItems(items) as Array<Record<string, unknown>>;
assert.deepEqual(result[0], items[0]);
assert.equal(JSON.stringify(result).includes('"type":"output_text"'), false);
});