Responses forced tool_choice failure from upstream (NextBit) crashes the turn: no recovery path in TransportPolicy #122
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
nsaspy/a0-symbolics#122
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Responses endpoints whose upstream cannot honor a forced tool call fail mid-stream with
response.failedand kill the whole agent turn. The transport'sTransportPolicy.recover()has no recovery path for this error class (it is neither a reasoning-effort, provider-state, builtin-tool, nor Responses-unsupported error), sounified_turnraises and the loop crashes with:Observed with
openrouter/z-ai/glm-5.3-flash(NextBit is the OpenRouter upstream provider).Environment
bba5dcbatool_choice(required) routed through a provider/upstream that does not reliably emit native tool calls under forcingRepro
did not return a valid tool call for the requested tool_choice(e.g.openrouter/z-ai/glm-5.3-flash).tool_choice: "required").response.failedevent;ResponsesEventParser.parseraisesRuntimeErrorfromhelpers/litellm_transport.py:1218.TransportPolicy.recover()matches nothing and returns RAISE; the turn dies.Expected / Actual
Expected: the transport degrades gracefully (retry once without the forced
tool_choice) and the turn completes with model-chosen tools or text.Actual: unhandled
RuntimeErrorcrashes the monologue loop.Evidence
Pre-fix detector check against the exact error text:
No matching classifier →
TransportRecovery.RAISE.Fix (branch
fix/responses-upstream-tool-choice, commitaf938ed6)TransportRecovery.RETRY_DROP_TOOL_CHOICE: on first occurrence, retry the request once withtool_choiceremoved._is_tool_choice_not_honored_error()matchingtool_choice+did not return a valid tool call.a0_drop_tool_choiceinternal kwarg honored by the Responses request builder; surfaced astool_choice_droppedcapability metadata; stripped from outbound requests.test_transport_retries_without_tool_choice_when_upstream_fails_forced_callintests/test_responses_architecture.py.tests/test_responses_architecture.py(13 passed),test_stream_tool_early_stop.py+test_model_call_extensions.py(50 passed).