fix(ai): deduplicate terminal response items

This commit is contained in:
Aiden Cline 2026-07-25 14:39:31 -05:00
commit d771c22e94
2 changed files with 43 additions and 8 deletions

View file

@ -1691,7 +1691,20 @@ describe("OpenAI Responses route", () => {
type: "response.output_item.done",
item: { type: "function_call", id: "item_1", call_id: "call_1", name: "lookup" },
},
{ type: "response.completed", response: {} },
{
type: "response.completed",
response: {
output: [
{
type: "function_call",
id: "item_1",
call_id: "call_1",
name: "lookup",
arguments: '{"query":"authoritative"}',
},
],
},
},
),
),
),
@ -1701,6 +1714,7 @@ describe("OpenAI Responses route", () => {
id: "call_1",
input: { query: "authoritative" },
})
expect(response.events.filter(LLMEvent.is.toolCall)).toHaveLength(1)
}),
)