Skip to content

desktop: reasoning part stops being recorded in a long session — chain-of-thought shows up as normal answer text #54298

Closed as not planned

Description

@EjikB

Summary

On OpenCode Desktop, in a long-running session, assistant turns eventually stop
containing a reasoning part. From that point on the model's chain-of-thought is
delivered as ordinary text, so the Desktop renders it inline with the answer
instead of a separate collapsible thoughts block. The user cannot tell thoughts
apart from the answer, and cannot collapse them. Fresh sessions on the same
provider/model are unaffected, so it appears to be a long-session / compaction
related regression.

Environment

  • opencode version: Desktop app 2.0.22 (Windows OpenCode.exe product version 2.0.22). The bundled/staged service had auto-updated to 2.0.26 mid-session; the affected session row has version: 2.0.22, a fresh session created minutes later has version: 2.0.26.
  • OS: Windows 10.0.19045.6456 (win32 x64)
  • Terminal: OpenCode Desktop app (Electron). TERM=xterm-256color
  • Shell: C:\WINDOWS\system32\cmd.exe
  • Install/channel: release desktop, channel=latest, provider OpenCode Zen (opencode/big-pickle)
  • Active plugins: none found in config

Reproduction

Not yet reduced to a deterministic reproduction. Observed while working normally:

  1. Use OpenCode Desktop in Build mode with model opencode/big-pickle (provider opencode), variant default (variants: [], so there is no reasoning variant to toggle).
  2. Keep one session going for a long time (this one reached ~347 assistant turns with several automatic compactions).
  3. At some point the assistant messages stop having a reasoning part; from then on the chain-of-thought is emitted as normal text and rendered inline.

Expected Behavior

Assistant turns keep a separate reasoning part so the Desktop shows a
collapsible thoughts block, separate from the final answer — as it did earlier in
the same session and as it still does in freshly created sessions.

Actual Behavior

Since a specific point in the session, assistant messages contain only
text (+ tool) parts and no reasoning part. The model's internal reasoning is
therefore written into the user-visible answer text. Nothing in the UI can
collapse it, because it is not tagged as reasoning.

Additional Context

Evidence from the local session database
(%USERPROFILE%/.local/share/opencode/opencode.db, V2 schema, session_message
table; content JSON holds an array of parts):

  • Affected session: ses_edb30a1a1ffe4rWn7RNlW7tqdK (title "Автономный Python-бот для Balatro"), agent build, model {id: big-pickle, providerID: opencode, variant: default}, version: 2.0.22.
  • Part-shape counts in that session: (reasoning,text,tool) x135, (text,tool) x110, (reasoning,tool) x69, (tool) x23, (text) x5, (reasoning,text) x4.
  • Time-ordered analysis shows repeated reasoning -> none transitions during the day, and the last such transition is permanent: after 2026-10-10 13:52:49 (local) no assistant turn in that session has a reasoning part again, while every turn before it oscillated between having and not having one.
  • The last reasoning -> none transition at 13:52:49 followed provider.updated and model.updated events logged at 13:52:28 (empty event.data). Another provider.updated fired at 13:54:20. A compaction message followed at 13:55:13.
  • Control: fresh opencode run --model opencode/big-pickle sessions created at 14:34–14:36 (same provider/model/agent) record reasoning parts normally (e.g. 55/55 assistant turns had a reasoning part in one), so the provider is still returning reasoning. The problem is specific to the long Desktop session.

Workarounds tried:

  • Nothing in the UI re-enables the reasoning part for that session; starting a new session restores it.
  • The model has no reasoning variants (variants: []), so this is not a variant/effort selection issue.

Related issues (Desktop reasoning display): #8789, #14340, #29212, #44809,
#37073, #21997.

Activity

  1. opencode-agent commented on Oct 10, 2026

    @opencode-agent
    Contributor

    Thanks for the detailed report and the database analysis.

    I tried to reproduce this on 2.0.22 with a simulated model. Every reply streamed a separate reasoning block followed by the answer. I ran several turns, ran a real /compact (the summary was accepted), then continued the session. Every turn before and after compaction kept its own reasoning part and showed as a collapsible "Thought" block. The reasoning never appeared as answer text. So when the provider sends reasoning on its separate channel, it is saved correctly even after compaction.

    That leaves two likely explanations I couldn't test here:

    • In a long context, big-pickle may start writing its thinking into the normal content instead of the reasoning field. OpenCode would then save it as text. This would also fit the on-and-off pattern earlier in the day.
    • The service updated from 2.0.22 to 2.0.26 in the middle of the session, right before the last switch.

    If you can, these would help:

    1. Run the server with --print-logs --log-level DEBUG (or check the log files) and send the raw response for one affected turn. Does the thinking arrive in the provider's content or in its reasoning field (reasoning_content / reasoning)?
    2. Does a new session that gets just as long and goes through compaction on 2.0.26 also lose its reasoning parts? Or does it only happen to sessions that started on 2.0.22 and continued after the update?
    3. Does the leaked text start with or contain <think> tags?

    Related issues:

  2. 00kino547 commented on Oct 11, 2026

    @00kino547

    Its also happening for me the thinking leaks, and i can answer something, it doesn't start with the tags, it tryed explaining to the agent that he isn't adding correctly the tags but he didn't was getting it...

  3. opencode-agent commented on Oct 13, 2026

    @opencode-agent
    Contributor

    I'm closing this for now, since we haven't heard back with the details needed to look into it further.

    In my test on 2.0.22, reasoning that the provider sends on its own channel was still saved as a separate part after compaction. Without the raw provider response for an affected turn, I can't tell whether big-pickle started writing its thinking into normal content, or whether this is linked to the 2.0.22 → 2.0.26 update during your session.

    If it happens again, please comment here and include the logged response for an affected turn (--print-logs --log-level DEBUG), and say whether a new long session on the current version is affected too. We can reopen it then. Related: #43770, #52377.

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