Skip to content

tool dispatch: shell tool silently removed mid-session; assistant emits tool-call XML as chat text and cannot build or verify #57541

Closed as not planned

Description

@SabreTrek

opencode Issue Report

Summary

Midway through a long session (~20 hours in), the shell/dispatch tool disappeared
from the assistant's available tools without notice. From that point on the
assistant could no longer run commands (compiler, file copy, backups), and it
began emitting raw tool-call XML into the chat transcript instead of executing
the call - producing visible garbage text such as:

<parameter name="path">C:\Users\Owner\.local\share\opencode <parameter name="pattern">**/*

The user saw no progress for many hours and lost confidence in every status
report. The root cause appears to be that the tool catalog changed underneath a
running session, and the assistant had no mechanism to detect this and fail
loudly.

Environment

  • opencode version: 2.0.32
  • OS: Windows_NT 10.0.19045 (win32 x64)
  • Terminal: Unavailable: terminal environment variables are not set
  • Shell: C:\WINDOWS\system32\cmd.exe
  • Install/channel: latest
  • Active plugins: None found in config

Reproduction

  1. Start a long-running session on Windows with a native C++ build workflow
    (MSVC cl.exe invoked via shell).
  2. Work normally for many hours - builds, file writes, and verification all
    succeed.
  3. At some point in the session, the tool catalog is re-published and the
    shell/dispatch tool is no longer included.
  4. Continue the session and ask for work that requires running a command.
  5. Observe: the assistant can no longer execute commands, has no error surfaced
    to the user, and begins writing tool-call markup as literal chat text instead
    of dispatch.

Expected Behavior

  • If a capability is removed mid-session, the session should surface this to the
    user explicitly and immediately (e.g. "the shell tool is no longer available in
    this session"), rather than letting the assistant continue as if nothing
    changed.
  • A tool call that fails to dispatch should produce an error in the transcript,
    never leak raw XML/markup into user-visible chat text.
  • The tool catalog should be stable for the lifetime of a session, or the change
    should be announced as an event the assistant can observe and report.

Actual Behavior

  • The shell tool silently vanished from the available tool set part way through
    the session.

  • No error was raised. The assistant continued attempting to use the missing
    capability.

  • Tool-call attempts were emitted as plain chat text, producing visible garbage
    in the transcript:

    <parameter name="path">C:\Users\Owner\.local\share\opencode <parameter name="pattern">**/*
    
  • The user could no longer tell the difference between "working", "stalled", and
    "finished", and became unable to trust any claimed result.

  • Roughly 10 hours of a multi-day project were lost, and the user's
    build/verification workflow broke completely.

Additional Context

  • The failure is reproducible within the affected session - it occurs on
    every attempt to execute a command.
  • It is not attributable to the user's machine: Windows, Visual Studio, and
    the filesystem all behaved normally; the fault is in tool availability and
    dispatch within opencode.
  • Frequency: continuous once it began - every command-dependent request after
    the catalog change failed.
  • Impact scope: any long-running session where the tool catalog changes
    mid-run. On Windows this is especially damaging because shell access is the
    only way to invoke a compiler, so the session becomes incapable of verifying
    its own work while still appearing to be active.
  • Workarounds tried: none succeeded. Asking the assistant to re-run the
    command, to check its environment, and to restart the investigation all
    produced the same non-dispatch behaviour. Only ending the session is expected
    to clear it.

Requested Fix (priority order)

  1. Never leak tool-call markup into chat text; if dispatch fails, render an
    explicit error instead.
  2. Detect and announce mid-session tool-catalog changes as a visible system
    message, so the assistant and the user both know a capability was removed.
  3. Keep the shell tool available for the full lifetime of a session, or provide
    a supported replacement before removing it.
  4. Add a guard that blocks the assistant from emitting <parameter/<invoke
    text into user-visible messages.

Reporting note

Reported against opencode 2.0.32; the dispatch failure was addressed in 2.1.1. Filed for the record so the incident details and the requested guards (no raw tool-call markup in chat text, announce mid-session tool-catalog changes) stay available for regression reference.

Activity

  1. opencode-agent commented on Oct 20, 2026

    @opencode-agent
    Contributor

    Thanks for the report, @SabreTrek. Before we can act on it, we need a few details:

    1. In your own words, briefly: what you were doing when it started, what you expected, and what you actually saw. The current text reads as an AI-written summary, and some of it (for example, that the tool catalog was re-published without the shell tool) seems to be a guess rather than something you observed.
    2. Provider and model you were using (for example, opencode/big-pickle or anthropic/claude-...). Raw <parameter name="..."> text in chat usually means the model wrote its tool call as plain text instead of making a real tool call, so the model matters.
    3. Evidence that the shell tool was actually removed, if you have any: an error, an "Instructions updated" notice in the transcript, or log lines from around when it started.
    4. Does it still happen on 2.1.1? You mention the problem was fixed in 2.1.1. If you no longer see it there, please say so.

    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 you're done editing.

    Possibly related issues, ordered by likelihood:

  2. opencode-agent commented on Oct 23, 2026

    @opencode-agent
    Contributor

    We haven't heard back, so I'm closing this issue for now, @SabreTrek. To look into it we'd still need three things: which provider and model you were using, any evidence that the shell tool was actually removed (an error, an "Instructions updated" notice or log lines), and whether the problem still happens on 2.1.1. You also mentioned it was fixed there.

    If it happens again on a current version, please reply here with those details or open a new issue, and we'll take another look. The raw <parameter name=...> text in chat is also being tracked in #57344.

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