Repository navigation
fix(OpenAI): parse reasoning item content - #848
Merged
iBotPeaches merged 2 commits intoNov 15, 2026
Merged
iBotPeaches merged 2 commits into
iBotPeaches merged 2 commits into
Conversation
OutputReasoning::from dropped the content array on a reasoning item, so reasoning_text never reached the completed response or a streamed output_item.
iBotPeaches
requested changes
Nov 14, 2026
Premake content the same way as summary and spread it into a single toArray() payload, omitting the key when content is null.
Contributor
Author
|
This comment was drafted with Claude Code. |
iBotPeaches
approved these changes
Nov 15, 2026
Collaborator
|
thanks! |
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.
What:
Description:
A Responses reasoning item can carry its chain of thought in
content, a list ofreasoning_textparts (the same shape conversation messages gained in #842).OutputReasoning::from()read onlysummary,encrypted_content, andstatus, so that text was dropped on the completed response and on streamedresponse.output_itemevents. Callers replaying the item, or reading reasoning from models that fillcontentinstead ofsummary, received an empty item.OutputReasoningnow mapscontentthroughOutputReasoningText(text,type). A missing or nullcontentstays null and is left out oftoArray(), so existing payloads still round-trip.response.output_itemevents parse the item with the same class.Tests cover a reasoning item that includes
reasoning_text, an explicit nullcontent, and anoutput_item.doneevent. The two content cases fail on main. The Pest suite passes (1456 passed, with the 35 deprecation notices already present on main). Pint and PHPStan are clean.Related:
Follow-up to #842, which added
reasoning_textparsing for conversation messages.This change was prepared with an AI coding assistant.