Skip to content

Tool-call emission sticks to bash after heavy Write-Output use; intended read/edit/glob calls emitted as bash Write-Output ... (mimo-v2.6-pro via opencode-go) #57584

Closed as not planned

Description

@sbricchi

Summary

After a phase of ~150 bash calls that use Write-Output "---" as output separators, the model's tool-name selection collapses to bash. Intended read/edit/glob/todowrite calls are emitted as bash calls with command: Write-Output "<intent text>" (e.g. Write-Output "using Read tool now", Write-Output "test read tool").

The model's reasoning explicitly says it will use the Read tool, while the emitted tool call is bash. The calls carry model-generated callIDs (e.g. call_33e9e71edc2e420387ea4ede), and permission=read is never evaluated in opencode.log during the incident — the calls never arrive as read/edit.

The state persists across app restart and session fork (the fork copies the poisoned history). Complex bash commands still work normally — only the tool-name selection collapses to bash + Write-Output.

Evidence

  • Reasoning vs emission mismatch (from part table of ~\.local\share\opencode\opencode.db):
    • reasoning: "I need to use the Read tool before Edit. Let me read the files properly with the Read tool."
    • emitted call: {"type":"tool","tool":"bash","callID":"call_33e9e71edc2e420387ea4ede","state":{"input":{"command":"Write-Output \"skip\""},...}}
  • The model's own probe strings leak intent: Write-Output "lectura via Read tool", Write-Output "using Read tool now", Write-Output "read tool required", Write-Output "pre-read ok".
  • opencode.log shows only permission=bash evaluations during the loop (allowed via action.permission=*); no permission=read|edit evaluations between 21:50–22:20Z.
  • Timeline (2026-10-20, UTC):
    • 18:58–19:02Z: read/edit/grep/todowrite all work fine (edits committed).
    • 19:02–21:50Z: merge-archaeology phase, heavy use of Write-Output "---" separators inside bash commands (~150 calls).
    • 21:50:21Z: first collapsed call (Write-Output done) — the turn where the model announced "Now I apply the changes. First I read the files with the Read tool" and emitted two bash calls instead of two read calls.
    • 21:50–22:19Z: ~300 degenerate probes (Write-Output "ok", Write-Output "x", Write-Output "a", ...), one per step, each with reasoning that insists on using Read/Edit.
    • Persists after restart + session fork: post-restart attempts to call read/glob/todowrite are again emitted as bash Write-Output "...".
  • NOT reproducible in a parallel session with the same model/provider running at the same time (same machine, same config): that session executed 34 edit, 16 read, 8 glob, 22 grep, 6 write without issues. Only the tool-name selection is affected in the poisoned session; multi-line PowerShell bash commands keep working there.

Steps to reproduce

  1. Long session with many bash calls that use Write-Output as output separators (~150+).
  2. Attempt to switch to read/edit tool for file work.
  3. Observe: the emitted call is bash with command: Write-Output "..." instead of the intended tool.

Expected

read/edit calls are emitted with the correct tool name, as they were earlier in the same session.

Actual

All non-bash tool attempts are emitted as bash/Write-Output "<intent text>", indefinitely, across restarts and forks.

Environment

  • opencode (Windows 11), llm.runtime=ai-sdk
  • providerID=opencode-go, modelID=mimo-v2.6-pro
  • 2026-10-20, sessions ses_ea5523ebbffe4lNJ86iSPgRb94 (incident) / ses_ea48e9746ffevOeLJV4TDNmgez (fork, still reproducible)

Activity

  1. opencode-agent commented on Oct 21, 2026

    @opencode-agent
    Contributor

    Thanks for the detailed report and the timeline.

    A couple of things would help us work out whether this comes from OpenCode or from the model:

    1. OpenCode version: please share the output of opencode --version and how you installed it.
    2. Another model on the same session: in the forked session (ses_ea48e9746ffevOeLJV4TDNmgez), switch to a different model (one not from the mimo family), ask it to read a file, and tell us whether it emits a real read call or also falls back to bash Write-Output.

    So far this looks like the model copying the pattern in its own history. The reasoning says "use Read" while the emitted call is bash, it only happens once the history holds about 150 Write-Output calls, it carries over into a fork (which copies that history), and a parallel session with the same model and config works fine. If another model behaves correctly on the same session, the problem is most likely with the model rather than OpenCode.

    You can reply here with the details or edit the issue. If you edit it, please also leave a comment saying you've updated it so we know when you're done.

    I didn't find an exact duplicate. These issues are related, ordered by likelihood:

  2. sbricchi commented on Oct 21, 2026

    @sbricchi
    Author
  3. opencode-agent commented on Oct 24, 2026

    @opencode-agent
    Contributor

    We haven't heard back, so I'm closing this for now. We still need the output of opencode --version and the result of asking a non-mimo model in the forked session (ses_ea48e9746ffevOeLJV4TDNmgez) to read a file. Those would tell us whether this is an OpenCode problem or mimo-v2.6-pro copying the Write-Output pattern from its own history.

    If you can share those details, please comment here or open a new issue that links to this one, and we'll take another look. Related reports you may want to follow: #50634, #57501 and #47759. Thanks again for the detailed write-up.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions