Files
new-api/relay/common
CaIon 335ebcff71 fix(relayconvert): keep Responses custom tools on Chat Completions upstreams
Responses to Chat conversion kept only function tools, so Codex custom
tools such as exec and apply_patch were dropped while the request still
succeeded. The model then called the remaining tools with made-up
arguments and Codex failed with "exec cell noop not found".

Custom tools are now sent as Chat functions that take a single string
input, with the grammar kept in the description. A forced custom
tool_choice becomes the matching function choice, and custom_tool_call
history items round-trip as function calls and tool messages.

On the way back, function calls to those tools are restored as
custom_tool_call output items, and streams emit the
custom_tool_call_input delta and done events.
2026-09-30 17:24:19 +08:00
..