Skip to content

v1.17.18: thinking leaks as literal text + TypeValidationError on usage (undefined) in message_delta (minimax-coding-plan/MiniMax-M3, Fedora/Kitty) #36387

Closed as not planned

Description

@HassanAhmedshm

Summary

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:

Type validation failed: Value: {"type":"message_delta","delta":{"stop_reason":""}}.
Error message: [
  {
    "expected": "object",
    "code": "invalid_type",
    "path": ["usage"],
    "message": "Invalid input: expected object, received undefined"
  }
]

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

  1. Install opencode 1.17.18.
  2. Configure provider minimax-coding-plan/MiniMax-M3 (this is the Minimax coding-plan provider, see https://opencode.ai).
  3. Send any prompt that triggers reasoning + a multi-token response.
  4. Observe: thinking renders as literal text in the output, then the turn aborts with the validation error above.

Environment

  • opencode: 1.17.18
  • OS: Fedora (latest)
  • Terminal: Kitty
  • Provider: minimax-coding-plan/MiniMax-M3 (model: MiniMax-M3)
  • Mode: TUI (default CLI)

Related issues

Suggested fix (skim)

  1. 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.
  2. 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.

Activity

  1. github-actions commented on Jul 11, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of or closely related to existing issues. Please check:

  2. mvallebr commented on Sep 4, 2026

    @mvallebr

    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 /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.

  3. 00kino547 commented on Oct 11, 2026

    @00kino547

    It also happens for me but with opencode zen (big pickle) after some time

  4. thdxr commented on Oct 11, 2026

    @thdxr
    Member

    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 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions