open_ai: Preserve separators between reasoning summaries - #62466
Merged
Conversation
bennetbo
approved these changes
Aug 11, 2026
playdohface
pushed a commit
to playdohface/zed
that referenced
this pull request
Aug 29, 2026
…ies#62466) OpenAI reasoning summaries are streamed as multiple indexed parts, and each new reasoning output item starts its indexes at zero. The Responses event mapper previously treated those indexes as global, so adjacent reasoning items could be concatenated without whitespace, producing text such as `**First item****Second item**`. Track the current summary part by both its item ID and summary index, and emit a separator whenever that pair changes. Text delta events now retain their summary index as a fallback when a separate part-added event is absent, while sharing the same boundary handling to avoid duplicate separators. Testing performed: - `cargo check -p open_ai` - `cargo nextest run -p open_ai` - `cargo fmt -p open_ai -- --check` - `./script/clippy -p open_ai` Release Notes: - Fixed missing separators between OpenAI reasoning summaries.
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.
OpenAI reasoning summaries are streamed as multiple indexed parts, and each new reasoning output item starts its indexes at zero. The Responses event mapper previously treated those indexes as global, so adjacent reasoning items could be concatenated without whitespace, producing text such as
**First item****Second item**.Track the current summary part by both its item ID and summary index, and emit a separator whenever that pair changes. Text delta events now retain their summary index as a fallback when a separate part-added event is absent, while sharing the same boundary handling to avoid duplicate separators.
Testing performed:
cargo check -p open_aicargo nextest run -p open_aicargo fmt -p open_ai -- --check./script/clippy -p open_aiRelease Notes: