Fix: remove unset fields from calls to Responses API#3026
Merged
seratch merged 3 commits intoopenai:mainfrom Apr 27, 2026
Merged
Fix: remove unset fields from calls to Responses API#3026seratch merged 3 commits intoopenai:mainfrom
seratch merged 3 commits intoopenai:mainfrom
Conversation
Remove 'status' key from input_item if it is None.
seratch
approved these changes
Apr 27, 2026
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.
Fixes a bug, very similar to #1883 , where GPT5 reasoning items contain a status=None field, causing the responses API to reject the request.
Issue
When using GPT-5, with sessions disabled and reasoning enabled, the first turn works normally, but on the second turn, reasoning items include an extra field status=None. When this field is passed back to the Responses API, the request fails with the following error:
Error getting response: Error code: 400 - {'error': {'message': "Unknown parameter: 'input[1].status'.", 'type': 'invalid_request_error', 'param': 'input[1].status', 'code': 'unknown_parameter'}}. (request_id: req_xxxxx)The original patch in PR #1883 , was fixing the issue when sessions were enabled but with sessions disabled a different code path is executed:
run_item_to_input_item()converts the items in-memory and uses the raw_item dict which still contains thestatusfield, that then is passed to the API.Solution:
Remove the field "status" if set and empty in
run_item_to_input_item()This update aligns with the approach in #1883 but solves it for the new code path.