Skip to content

fix(opencode): synthesize reasoning-start for incomplete streams#25195

Closed
jackmazac wants to merge 1 commit into
anomalyco:devfrom
jackmazac:pr/upstream-2-reasoning-stream
Closed

fix(opencode): synthesize reasoning-start for incomplete streams#25195
jackmazac wants to merge 1 commit into
anomalyco:devfrom
jackmazac:pr/upstream-2-reasoning-stream

Conversation

@jackmazac
Copy link
Copy Markdown

Issue for this PR

Closes #25191

Type of change

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

What does this PR do?

When a model stream emits reasoning deltas without a preceding reasoning-start event, the LLM wrapper injects a synthetic start so downstream session/UI logic always sees a well-formed reasoning span.

How did you verify your code works?

From packages/opencode: bun typecheck and stream/session tests touching wrapStream / LLM pipeline where applicable.

Screenshots / recordings

N/A — not a UI change.

Checklist

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

wrapStream middleware enqueues reasoning-start before delta/end
when the provider skipped the opening chunk for that id.
@jackmazac
Copy link
Copy Markdown
Author

Closing per contributor request.

@jackmazac jackmazac closed this May 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stream path can omit reasoning-start for downstream UI

1 participant