You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
code mode: advertised search tool is unavailable #43925
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
Start OpenCode 2 and use the Code Mode execution tool.
Run code that invokes the advertised discovery API:
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.
This issue might be a duplicate of an existing issue. Please check:
codemode: Executor nested tool search fails in TUI #40611: Same root cause — tools.search() in Code Mode resolves against OpenCode's outer Code Mode catalog instead of the MCP server's runtime catalog, producing the identical Unknown tool 'search' error.
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:
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.
Activity
github-actions commentedon Aug 21, 2026
This issue might be a duplicate of an existing issue. Please check:
tools.search()in Code Mode resolves against OpenCode's outer Code Mode catalog instead of the MCP server's runtime catalog, producing the identicalUnknown tool 'search'error.opencode-agent commentedon Aug 21, 2026
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.