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>
| Name |
Last commit
|
Last Update |
|---|---|---|
| .. | ||
| internal | Loading commit data... | |
| media.go | Loading commit data... | |
| request_compat.go | Loading commit data... | |
| request_registry.go | Loading commit data... | |
| request_registry_test.go | Loading commit data... | |
| response_compat.go | Loading commit data... | |
| response_registry.go | Loading commit data... | |
| response_registry_test.go | Loading commit data... | |
| text_converter_registry.go | Loading commit data... | |
| text_converter_registry_test.go | Loading commit data... |