You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Model: any OpenAI-compatible reasoning model that streams reasoning_content (DeepSeek, Kimi, Qwen, ...)
Platform: Windows
Problem
Reasoning output is fragmented in the UI: every single reasoning token opens and closes its own reasoning-start / reasoning-end cycle instead of accumulating into one contiguous reasoning block. The thinking text renders word-by-word on separate lines and flickers, instead of one continuous block.
Reproduction
Configure any model routed through @ai-sdk/openai-compatible that returns reasoning_content.
Send any prompt.
Observe the thinking block: each token is toggled on/off separately rather than appended to one block.
Evidence
Replaying the same captured SSE stream (model streams reasoning_content token by token) under Node, counting the emitted events:
version
reasoning-start
reasoning-end
reasoning-delta
2.0.41 (currently bundled)
268
268
268
2.0.75 (latest 2.x)
1
1
268
With 2.0.41 every token becomes its own reasoning cycle; with 2.0.75 the stream is correctly kept as a single contiguous block (268 deltas appended to one part).
Root cause
Already fixed upstream in 2.0.75:
vercel/ai commit f3c1980: fix(openai-compatible): keep reasoning streams contiguous when deltas include empty tool call arrays
opencode currently bundles 2.0.41 (see #17902, where a maintainer confirmed "we use @ai-sdk/openai-compatible: 2.0.41"; the lockfile pins 2.0.41 as well), which does not include this fix.
Request
Please bump the bundled @ai-sdk/openai-compatible from 2.0.41 to the latest 2.0.75:
This stays within the 2.x line (specificationVersion: v3) and remains compatible with the current AI SDK 6 core, so no core upgrade is required.
Adding a self-contained repro that needs no captured traffic — only the trigger condition (a delta carrying reasoning_content together with an empty tool_calls: [] array, which is what DeepSeek/llama.cpp-style streams emit on every reasoning chunk).
I also replayed a real captured DeepSeek stream (268 reasoning tokens, each delta carrying tool_calls: []):
2.0.41 → reasoning-start:268 / reasoning-end:268
2.0.75 → reasoning-start:1 / reasoning-end:1
Both confirm the fix already present in 2.0.75 (f3c1980 — "keep reasoning streams contiguous when deltas include empty tool call arrays") is exactly what un-fragments these streams. Bumping the bundled version from 2.0.41 to 2.0.75 resolves it without touching the AI SDK 6 core.
Activity
lscar commentedon Sep 21, 2026
Adding a self-contained repro that needs no captured traffic — only the trigger condition (a delta carrying
reasoning_contenttogether with an emptytool_calls: []array, which is what DeepSeek/llama.cpp-style streams emit on every reasoning chunk).repro.mjs:Output — identical
[email protected]core, only the provider differs:@ai-sdk/[email protected]:@ai-sdk/[email protected]:I also replayed a real captured DeepSeek stream (268 reasoning tokens, each delta carrying
tool_calls: []):2.0.41→reasoning-start:268 / reasoning-end:2682.0.75→reasoning-start:1 / reasoning-end:1Both confirm the fix already present in
2.0.75(f3c1980— "keep reasoning streams contiguous when deltas include empty tool call arrays") is exactly what un-fragments these streams. Bumping the bundled version from2.0.41to2.0.75resolves it without touching the AI SDK 6 core.thdxr commentedon Oct 11, 2026
Thanks for the report! OpenCode 2.0 is now out and development is focused on V2, so we're closing issues filed against OpenCode 1. Please upgrade (
opencode upgrade --major, details: https://anoma.ly/notes/opencode-2-0), and if this is still relevant on 2.0, reopen this issue or open a new one with your 2.0 version.— from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊