Code Mode catalog misleads model into calling built-in tools as tools.read inside execute; direct read() works · Issue #57720 · anomalyco/opencode · GitHub
Skip to content

Code Mode catalog misleads model into calling built-in tools as tools.read inside execute; direct read() works #57720

Open

Description

@MeLlamoArroz

Description

Description

On a fresh, clean installation of OpenCode V2.1.2, the model is presented with a tool catalog that lists built-in tools (read, shell, glob, grep, etc.) alongside the execute tool. The execute tool's description instructs: "Call tools through tools using only exact paths and signatures from the catalog." The model therefore reasonably attempts tools.read({ path: '.' }) inside execute, which fails with:

Unknown tool 'read'. Did you mean tools.opencode.read_mcp_resource?

The model then wastes several turns trying variations (tools.shell, tools.glob, checking the catalog again) before eventually discovering that calling read directly (outside execute) works fine:

→Explored: 1 read
→Read .

So the built-in tools are available, they are simply not proxied through tools.* inside execute, and nothing in the catalog or the execute instructions tells the model that. This happens in both Build mode and Plan mode, and regardless of the OPENCODE_EXPERIMENTAL_CODE_MODE flag.

Environment

  • opencode version: V2.1.2> (fresh install, V2 only)
  • Modes tested: Build mode and Plan mode
  • Code Mode flags tested: OPENCODE_EXPERIMENTAL_CODE_MODE=0 (disabled) and =true (enabled)
  • Prior V1 installation: none (clean system)
  • OS: Manjaro Linux 6.1.187-2

Plugins

No response

OpenCode version

2.1.2

Steps to reproduce

  1. Perform a clean install of OpenCode V2 on a system with no prior V1 installation and no existing ~/.config/opencode, ~/.local/share/opencode, or ~/.cache/opencode.
  2. Start a session in any project directory in Build mode.
  3. Ask the model to inspect the current directory, e.g.:

    "Check my project in the current directory, give me your opinion."

  4. Observe the model call execute with tools.read({ path: '.' }).
  5. Observe the failure: Unknown tool 'read'. Did you mean tools.opencode.read_mcp_resource?
  6. Observe the model eventually call read directly (not via tools.), which succeeds.
  7. Repeat with OPENCODE_EXPERIMENTAL_CODE_MODE=0 and =true — the misleading catalog and the failed tools.read attempt occur in both cases.
  8. Repeat in Plan mode — same behavior.

Screenshot

No response

Operating System

Manjaro Linux 6.1.187-2

Terminal

terminator

Activity

  1. opencode-agent commented on Oct 21, 2026

    @opencode-agent
    Contributor

    Thanks for the detailed report! I think this is a duplicate of #53623. That issue reports the same thing: the Code Mode instructions lead the model to call built-in tools like read, shell and glob as tools.* inside execute, where they fail with Unknown tool …, when they should be called directly.

    Possible duplicates and related issues, ordered from most to least likely:

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

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