Repository navigation
fix(llm): drop status from every replayed Responses input item - #2454
Merged
Merged
Conversation
Strict OpenAI-compatible gateways reject any `status` on input items with `Unknown parameter: 'input[N].status'`. The retry only handled items of type `message`, so a rejected `function_call` item re-raised and the whole turn fell back to the generic "could not produce a useful response" text. Strip `status` from every replayed item, not only messages. The retry still fires only on the named-index rejection, and the model is remembered so later turns skip the wasted round trip. Fixes HKUDS#2450 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Strict OpenAI-compatible gateways reject any
statuson a Responses API input item withUnknown parameter: 'input[N].status'. The existing retry only strippedstatusfrom items of typemessage. When the rejected item was a replayedfunction_call,_responses_body_without_input_message_statusreturnedNone, the error propagated, and the turn fell back to "I could not produce a useful response".Changes:
_responses_body_without_input_message_statusnow stripsstatusfrom every dict item, not onlymessage.Not changed:
converters.convert_messagesstill replaysstatuson the first attempt. Stripping it up front would change requests toapi.openai.comfor every user, so I kept the fix at the retry boundary. Happy to strip it up front if you prefer.Related Issues
status; strict OpenAI-compatible gateways reject withUnknown parameter: 'input[N].status'#2450Module(s) Affected
services/llmtestsChecklist
dev(notmain).deeptutor-repo-hygiene, which callspython3and fails only on Windows.python scripts/check_repo_hygiene.pypasses.Additional Notes
test_a_rejected_status_on_a_replayed_function_call_is_stripped_toointests/services/llm/test_responses_input_status_retry.py.test_responses_input_status_retry.pyandtest_github_copilot_provider.py: 54 passed.🤖 Generated with Claude Code