fix: OpenAIResponsesChatGenerator filter streaming event fields from reasoning extra before call to Responses API#11720
Open
davidsbatista wants to merge 1 commit into
Open
fix: OpenAIResponsesChatGenerator filter streaming event fields from reasoning extra before call to Responses API#11720davidsbatista wants to merge 1 commit into
OpenAIResponsesChatGenerator filter streaming event fields from reasoning extra before call to Responses API#11720davidsbatista wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Contributor
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
||||||||||||||||||||||||
OpenAIResponsesChatGenerator filter streaming event fields from reasoning extra before call to Responses API
sjrl
reviewed
Jun 23, 2026
Comment on lines
+934
to
938
| _valid_reasoning_fields = {"id", "type", "encrypted_content", "status"} | ||
| filtered_extra = {k: v for k, v in reasoning.extra.items() if k in _valid_reasoning_fields} | ||
| reasoning_item = {"summary": [], **filtered_extra} | ||
| if reasoning.reasoning_text: | ||
| reasoning_item["summary"] = [{"text": reasoning.reasoning_text, "type": "summary_text"}] |
Contributor
There was a problem hiding this comment.
@davidsbatista It seems there is one more supported field I think according to docs here https://developers.openai.com/api/reference/resources/responses/methods/retrieve#(resource)%20responses%20%3E%20(model)%20response_output_item%20%3E%20(schema)%20%3E%20(variant)%207
I think the content field as well which is structured similarly to summary. I'm not entirely sure how we are meant to distinguish between summary and content fields currently.
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.
Proposed Changes:
In Previous PR Fix streaming reasoning conversion to preserve extra fields #11669: streaming
response.reasoning_summary_text.deltaevents spread event-level fields (item_id,output_index,summary_index, etc.) intoReasoningContent.extra. When sent back in next calls the API rejected them withUnknown parameter: 'input[N].item_id'.Fix filters
reasoning.extrato only valid reasoning input item fields (id,type,encrypted_content,status) before serialising.How did you test it?
test_live_run_with_agent_streaming_and_reasoning— was failing Windows without the fix, passes with it.Checklist
fix:,feat:,build:,chore:,ci:,docs:,style:,refactor:,perf:,test:and added!in case the PR includes breaking changes.