Skip to content

fix(llm): drop status from every replayed Responses input item - #2454

Merged
pancacake merged 1 commit into
HKUDS:devfrom
Mahdi-Hasan:fix/2450-responses-input-status
Nov 5, 2026
Merged

pancacake merged 1 commit into
HKUDS:devfrom
Mahdi-Hasan:fix/2450-responses-input-status

Conversation

@Mahdi-Hasan

Copy link
Copy Markdown
Contributor

Description

Strict OpenAI-compatible gateways reject any status on a Responses API input item with Unknown parameter: 'input[N].status'. The existing retry only stripped status from items of type message. When the rejected item was a replayed function_call, _responses_body_without_input_message_status returned None, the error propagated, and the turn fell back to "I could not produce a useful response".

Changes:

  • _responses_body_without_input_message_status now strips status from every dict item, not only message.
  • The retry still fires only on a named-index rejection. The caller's body is not mutated.
  • The model is still remembered after the first rejection, so later turns skip the wasted round trip.

Not changed: converters.convert_messages still replays status on the first attempt. Stripping it up front would change requests to api.openai.com for every user, so I kept the fix at the retry boundary. Happy to strip it up front if you prefer.

Related Issues

Module(s) Affected

  • Other: services/llm
  • tests

Checklist

  • This PR targets dev (not main).
  • I have read and followed the contribution guidelines.
  • My code follows the project's coding standards.
  • I have run the pre-commit hooks. All pass except deeptutor-repo-hygiene, which calls python3 and fails only on Windows. python scripts/check_repo_hygiene.py passes.
  • I have added relevant tests for my changes.
  • I have updated the documentation (if necessary). Not needed: no user docs cover this path.
  • My changes do not introduce any new security vulnerabilities.

Additional Notes

  • New test: test_a_rejected_status_on_a_replayed_function_call_is_stripped_too in tests/services/llm/test_responses_input_status_retry.py.
  • test_responses_input_status_retry.py and test_github_copilot_provider.py: 54 passed.
  • Not verified against a live strict gateway.

🤖 Generated with Claude Code

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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants