Commit Graph
1 Commits
Author SHA1 Message Date
NikuandClaude Fable 5 1086038f5f fix: prevent duplicate tool calls in Responses-to-Chat streaming (#6225)
When a function call was already registered under its output_index key
via response.output_item.added, the synthetic events built from the
terminal response.completed output carry no output_index and resolve to
a different item-based key. ensureToolForEvent then created a second
tool index and resent the full arguments, so Chat Completions clients
received the same tool call twice.

Reuse the tool registered under itemIDToKey/callIDToKey before creating
a new one, and alias the new key to the existing tool.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-18 12:50:02 +08:00