Skip to content

tui: reasoning rendered as plain text for models that emit a closing thinking tag without an opening one #55414

Closed as duplicate

Description

@nick-o

Description

Reasoning from the built-in opencode/big-pickle model is rendered in the transcript as normal assistant text instead of a separate collapsible thinking block. Hiding/toggling thinking has no effect, because no reasoning part is produced.

The model streams its reasoning followed by a closing </think> marker but never an opening <think> marker:

<reasoning text...></think><answer...>

OpenCode already has code to turn this pattern into a reasoning part, but it (a) requires the opening <think> marker and (b) is hardcoded to a single model id, so it never runs for this model:

  • the streamed extractor only triggers when accumulated content startsWith("<think>"), and the batch splitter looks for indexOf("<think>"); with no opening marker, everything remains text;
  • both are gated by function UVo(e){return ["qwen3-4b"].includes(e)}, i.e. tag-based splitting only runs for qwen3-4b.

Counting across all assistant messages in an active session: opening <think> appears 0 times, closing </think> appears 39 times (every message).

Expected: reasoning is separated into a reasoning part and can be hidden/toggled.
Actual: reasoning plus </think> is stored and displayed as ordinary text.

Plugins

Local plugins: nudge, pathfix (~/.config/opencode/plugins/)

OpenCode version

2.0.20 (Homebrew)

Steps to reproduce

  1. Select the model opencode/big-pickle for a session.
  2. Send any message.
  3. The response shows the model's raw reasoning as plain text, terminated by </think>, with no separate thinking block.

Operating System

macOS (Darwin 25.2.0, arm64)

Terminal

iTerm2

Activity

  1. changed the title [-]tui: reasoning rendered as plain text when a model emits only a closing thinking tag[/-] [+]tui: reasoning rendered as plain text for models that emit a closing thinking tag without an opening one[/+] on Oct 14, 2026
  2. opencode-agent commented on Oct 14, 2026

    @opencode-agent
    Contributor

    Thanks for the detailed report, @nick-o, especially the tag counts and the pointer to the existing extraction code.

    I think this is a duplicate of #54599: opencode/big-pickle sends its reasoning inline, ending with </think> and no opening <think>, and OpenCode saves it as a normal text part instead of a reasoning block. That issue has already been reproduced, and there is a proposed fix in #54612.

    Possible duplicates and related issues, ordered by likelihood:

    Your notes on why the existing tag extraction never runs (it needs an opening <think> and only applies to qwen3-4b) would be a useful addition on #54599.

    The bot will close this issue as a duplicate in 1 day unless you reply explaining how your problem is different.

  3. nick-o commented on Oct 14, 2026

    @nick-o
    Author

    Duplicate of #54599 (same model, same symptom: opencode/big-pickle streams inline reasoning ending in </think> with no opening thinking, stored as a text part instead of a reasoning part). Fix tracked in #54612. I've moved the code-level detail (why the current extraction never fires) to #54599. Closing as duplicate.

  4. opencode-agent commented on Oct 14, 2026

    @opencode-agent
    Contributor

    Thanks, @nick-o, and thanks for moving the details about the extraction code to #54599. That's the best place to follow this, along with the proposed fix in #54612. The bot will close this issue as a duplicate shortly.

  5. opencode-agent commented on Oct 15, 2026

    @opencode-agent
    Contributor

    Closing as a duplicate of #54599, which you confirmed is the same problem: opencode/big-pickle reasoning that ends in </think> with no opening tag is saved as a normal text part. Please follow #54599 and the proposed fix in #54612. Thanks for adding your findings there, @nick-o.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions