fix(transport): retry without tool_choice when upstream fails forced tool call #123

Merged
nsaspy merged 1 commit from fix/responses-upstream-tool-choice into main 2026-09-08 13:14:51 +00:00
Collaborator

Closes #122. Adds TransportRecovery.RETRY_DROP_TOOL_CHOICE so a Responses response.failed of the form 'upstream model did not return a valid tool call for the requested tool_choice' (observed via OpenRouter/NextBit upstreams) retries once with tool_choice dropped instead of crashing the turn, exposes tool_choice_dropped capability metadata, and adds a regression test.

Closes #122. Adds TransportRecovery.RETRY_DROP_TOOL_CHOICE so a Responses response.failed of the form 'upstream model did not return a valid tool call for the requested tool_choice' (observed via OpenRouter/NextBit upstreams) retries once with tool_choice dropped instead of crashing the turn, exposes tool_choice_dropped capability metadata, and adds a regression test.
Responses endpoints that cannot honor tool_choice (e.g. OpenRouter upstream
'NextBit: upstream model did not return a valid tool call for the requested
tool_choice') surfaced as an unhandled response.failed mid-stream, killing the
agent loop. TransportPolicy now retries once with tool_choice dropped and
records a tool_choice_dropped capability flag.
nsaspy merged commit d921c0f670 into main 2026-09-08 13:14:51 +00:00
Sign in to join this conversation.
No description provided.