Skip to content

Fix: remove unset fields from calls to Responses API#3026

Merged
seratch merged 3 commits intoopenai:mainfrom
s0rc3r3r01:fix-reasoning-unknown-parameter-bug
Apr 27, 2026
Merged

Fix: remove unset fields from calls to Responses API#3026
seratch merged 3 commits intoopenai:mainfrom
s0rc3r3r01:fix-reasoning-unknown-parameter-bug

Conversation

@s0rc3r3r01
Copy link
Copy Markdown
Contributor

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 the status field, 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.

Remove 'status' key from input_item if it is None.
@github-actions github-actions Bot added bug Something isn't working feature:core labels Apr 25, 2026
@seratch seratch added this to the 0.14.x milestone Apr 27, 2026
@seratch seratch merged commit 8025ed0 into openai:main Apr 27, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working feature:core

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants