Skip to content

fix(llm): serialize overlapping OpenAI reasoning - #37022

Closed
xiaodream551-a11y wants to merge 1 commit into
anomalyco:v2from
xiaodream551-a11y:openai-reasoning-overlap
Closed

fix(llm): serialize overlapping OpenAI reasoning#37022
xiaodream551-a11y wants to merge 1 commit into
anomalyco:v2from
xiaodream551-a11y:openai-reasoning-overlap

Conversation

@xiaodream551-a11y

@xiaodream551-a11yxiaodream551-a11y commented Jul 15, 2026

Copy link
Copy Markdown

Issue for this PR

Fixes#36892

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

OpenAI Responses can start another reasoning summary before the previous item has fully ended. V2 persists one reasoning block at a time, so those overlapping starts terminate the run with reasoning start before end.

This serializes overlapping reasoning events before publishing them, while retaining text/tool order and final encrypted continuation metadata. Reused provider block IDs are isolated so late deltas cannot merge into an earlier block.

How did you verify your code works?

  • Added a deterministic SSE regression covering overlapping summaries, interleaved text, final encrypted metadata, and a late reused block ID.
  • bun run test in packages/llm (319 passed, 29 skipped).
  • bun run typecheck in packages/llm and packages/core.
  • The pre-push bun turbo typecheck --concurrency=3 hook passed across 32 packages.

Screenshots / recordings

Not applicable; this is a non-UI stream parser fix.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actionsgithub-actionsBot added needs:issue needs:compliance This means the issue will auto-close after 2 hours. labels Jul 15, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actionsgithub-actionsBot removed the needs:compliance This means the issue will auto-close after 2 hours. label Jul 15, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

@xiaodream551-a11y

Copy link
Copy Markdown
Author

The linked issue is #36892 and the PR template now references it as Fixes #36892. This PR targets v2, while the repository default branch is dev; GitHub leaves closingIssuesReferences empty for non-default-base PRs, so the standards workflow appears to report a false negative. Could a maintainer clear the needs:issue label?

@github-actions

Copy link
Copy Markdown
Contributor

Automated PR Cleanup

Thank you for contributing to opencode.

Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions.

This PR was closed because it matched the following cleanup criteria:

  • The PR was created more than 1 month ago
  • The PR had fewer than 2 positive reactions
  • Positive reactions are counted as thumbs-up, heart, celebration, or rocket reactions on the PR

PRs created within the last month are not affected by this cleanup.

If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate.

Thanks again for taking the time to contribute.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@xiaodream551-a11y