Skip to content

open_ai: Preserve separators between reasoning summaries - #62466

Merged
Veykril merged 1 commit into
mainfrom
lukaswirth/fix-openai-reasoning-summary-separators
Aug 11, 2026
Merged

open_ai: Preserve separators between reasoning summaries#62466
Veykril merged 1 commit into
mainfrom
lukaswirth/fix-openai-reasoning-summary-separators

Conversation

@Veykril

@Veykril Veykril commented Aug 11, 2026

Copy link
Copy Markdown
Member

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.

@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label Aug 11, 2026
@zed-community-bot zed-community-bot Bot added the staff Pull requests authored by a current member of Zed staff label Aug 11, 2026
@Veykril
Veykril added this pull request to the merge queue Aug 11, 2026
Merged via the queue into main with commit a491626 Aug 11, 2026
50 checks passed
@Veykril
Veykril deleted the lukaswirth/fix-openai-reasoning-summary-separators branch August 11, 2026 09:10
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement staff Pull requests authored by a current member of Zed staff

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants