# open_ai: Preserve separators between reasoning summaries \(\#62466\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/a49162656edfc73c85b856f7762bf827d1cfc118)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: a49162656edfc73c85b856f7762bf827d1cfc118

Requested commit: a49162656edfc73c85b856f7762bf827d1cfc118

Commit: a49162656edfc73c85b856f7762bf827d1cfc118

Tree: f9d0ff28f8342f358e4ee441740172042a1fe1bd

Author: Lukas Wirth

Committer: GitHub

## Message

```
open_ai: Preserve separators between reasoning summaries (#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.
```

## Parents

- [7807e4b12258c210d98cd052a179411eedec610f](https://git.cafe/gitcafe/zed/commit/7807e4b12258c210d98cd052a179411eedec610f?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/a49162656edfc73c85b856f7762bf827d1cfc118?format=markdown)
