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
{{ message }}
Repository navigation
v1.17.18: thinking leaks as literal text + TypeValidationError on usage (undefined) in message_delta (minimax-coding-plan/MiniMax-M3, Fedora/Kitty) #36387
Two distinct bugs that both reproduce in the same session on opencode 1.17.18, provider minimax-coding-plan/MiniMax-M3, Fedora + Kitty terminal. Both surface during streaming; the second one aborts the turn.
Bug 1 — thinking blocks leak as literal text between content blocks
During streaming, the assistant's reasoning / chain-of-thought appears as visible plain-text content bracketed by <think>…</think> (or equivalent), instead of being rendered in a collapsible reasoning panel like Anthropic / OpenAI o-series / DeepSeek outputs.
Expected: thinking content streams into a hidden/collapsible reasoning section (same as Claude, GPT-o, DeepSeek, etc.), invisible by default.
Actual: raw <think>…</think> text appears inline in the assistant message, between visible content blocks.
Bug 2 — TypeValidationError: usage is undefined on message_delta
When the stream reaches stop_reason: "", opencode aborts with:
The provider emits a message_delta SSE event whose top-level usage field is undefined (Anthropic-compatible shape), but opencode's Zod schema requires usage to be an object on every message_delta. The turn dies before the final message_stop.
Repro
Install opencode 1.17.18.
Configure provider minimax-coding-plan/MiniMax-M3 (this is the Minimax coding-plan provider, see https://opencode.ai).
Send any prompt that triggers reasoning + a multi-token response.
Observe: thinking renders as literal text in the output, then the turn aborts with the validation error above.
Bug 2 (one-liner): make usage optional in the message_delta Zod schema for the Anthropic-shaped provider. Anthropic's SSE spec explicitly allows usage to be absent on message_delta (it is sent on message_start and optional on later deltas); current strict schema rejects valid streams.
Bug 1: route reasoning content through the same hidden/collapsible rendering pipeline used for Claude/GPT-o, regardless of provider — the parser is likely treating the provider's reasoning field as plain text instead of as a structured reasoning part.
The configuration routes MiniMax-M3 through the OpenAI-compatible /v1 endpoint and enables reasoning_split: true. This makes MiniMax return reasoning separately instead of embedding <think>...</think> in content. It also avoids the Anthropic-compatible message_delta shape where usage may be omitted.
I have not yet confirmed this against the exact OpenCode version from this issue, but it may be worth testing.
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.
Activity
github-actions commentedon Jul 11, 2026
This issue might be a duplicate of or closely related to existing issues. Please check:
<think>and<thinking>tags as reasoning blocks #11439: Support parsing<think>and<thinking>tags as reasoning blocks (root-cause tracking issue for Bug 1)mvallebr commentedon Sep 4, 2026
I may have found a provider-level workaround for both symptoms described here:
https://gist.github.com/mvallebr/877f2dabb5da269091d2e2725a77b218
The configuration routes MiniMax-M3 through the OpenAI-compatible
/v1endpoint and enablesreasoning_split: true. This makes MiniMax return reasoning separately instead of embedding<think>...</think>incontent. It also avoids the Anthropic-compatiblemessage_deltashape whereusagemay be omitted.I have not yet confirmed this against the exact OpenCode version from this issue, but it may be worth testing.
00kino547 commentedon Oct 11, 2026
It also happens for me but with opencode zen (big pickle) after some time
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 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊