Skip to content

code mode: advertised search tool is unavailable #43925

Closed as not planned
Closed as not planned

Description

@LeoLeal

Summary

Code Mode advertises a search discovery tool, but executing tools.search(...) fails with Unknown tool 'search'. This prevents tool discovery and blocks tool execution workflows that follow the provided Code Mode catalog.

Environment

  • opencode version: v0.0.0-beta-17793
  • OS: Linux 6.18.33.2-microsoft-standard-WSL2 (x86_64)
  • Terminal: TERM=xterm-256color; TERM_PROGRAM and COLORTERM unset
  • Shell: /bin/bash
  • Install/channel: beta
  • Active plugins: None configured; local plugins directory is empty
  • MCP servers: chrome-devtools and pen.dev connected

Reproduction

  1. Start OpenCode 2 and use the Code Mode execution tool.
  2. Run code that invokes the advertised discovery API:
    await tools.search({ query: "chrome-devtools navigate", namespace: "chrome-devtools" })
  3. Observe the error:
    Unknown tool 'search'.
    The tool may have been removed or renamed. Use search to find available tools.
    

Expected Behavior

tools.search(...) should be available when Code Mode advertises it, returning the matching tool signatures. Alternatively, it should not be advertised and the error should give a usable alternative.

Actual Behavior

The runtime rejects tools.search(...) as unknown, while its error message instructs the caller to use that same unavailable tool.

Additional Context

The shared background service is healthy:

{"healthy":true,"version":"0.0.0-beta-17793","pid":3837}

No matching Unknown tool or Code Mode errors were found in the OpenCode log. The issue appears consistently reproducible in this session.

Activity

  1. github-actions commented on Aug 21, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of an existing issue. Please check:

  2. opencode-agent commented on Aug 21, 2026

    @opencode-agent
    Contributor

    Thanks for the report. We can't reproduce this as a V2 bug.

    There are zero agent-facing mentions or instructions in V2 telling the model to call `tools.search(...)`. Code Mode explicitly instructs the model to use `search` directly, and the advertised signature is generated as `search(input: ...): ...`. The execution-tool instructions also distinguish the built-in `search` function from catalog tools, which are called through `tools` using their returned paths: source.

    The reproduction is calling the wrong API. The correct form is:

    ```js
    await search({ query: "chrome-devtools navigate", namespace: "chrome-devtools" })
    ```

    Closing as unable to reproduce. If you encounter a session where the agent is somehow instructed to use `tools.search(...)` again, please send the full exported session transcript so we can inspect the exact instructions and tool catalog it received.

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions