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
tools: code mode catalog omits built-in tools, so tools.shell fails with "Unknown tool shell" #60014
Inside Code Mode (execute) the tool catalog only exposes MCP tools and the opencode namespace. Built-ins (shell, read, grep, glob, webfetch, websearch) are absent, so tools.shell(...) fails with Unknown tool 'shell', even though shell is permitted and works when called as a top-level tool.
Also call search({ query: "" }) and inspect the returned catalog.
Expected Behavior
Either tools.shell resolves inside Code Mode, or the failure names the working alternative (that shell is a top-level tool). The docs describe the runtime as exposing tools "from its catalog" and never say built-ins are excluded.
Actual Behavior
✗execute
↳ Unknown tool 'shell'.
Use search to find available tools.
search({ query: "" }) returns 21 entries, all tools.github.* (13) and tools.opencode.* (8). No built-in appears, so the suggested search cannot resolve shell either. Calling the top-level shell tool with the same command in the same session succeeds.
Additional Context
Not a permission problem: GET /api/agent reports plan permissions as * allow with edit denied (plus the ~/.opencode/plan/* exception); shell is allowed and works directly.
Reproduced consistently in a plan session; not verified under build.
Impact is cosmetic — one failed tool call, no side effects — but it fires whenever the model guesses tools.shell, and the error hint points to search, which cannot find the tool.
Workaround: call shell directly instead of through execute.
Thanks for the clear report! I think this is a duplicate of #53623.
In v2, built-in tools like shell, read, grep, glob, webfetch and websearch are top-level only by design: they're registered outside the Code Mode catalog, so tools.shell(...) inside execute isn't expected to work. The real problem is the one you describe: the Code Mode instructions never say built-ins stay top-level, and the Unknown tool hint sends the model to search, which can't find them. #53623 tracks exactly that.
Possible duplicates and related issues, ordered from most to least likely:
"Code Mode" instructions are confusing Gemma-4-31B #53623: same problem. The Code Mode wording leads models to call built-in tools as tools.* inside execute, and search can't find them. A maintainer said the instructions will be adjusted.
We haven't heard back, so I'm closing this as a duplicate of #53623. That issue covers the same problem: the Code Mode instructions don't say that built-in tools like shell, read and grep are only called at the top level. Models then try tools.shell(...) inside execute, get Unknown tool 'shell', and the search hint can't find the tool. Please follow #53623 for updates. PR #57627 proposes new wording for the prompt.
If you'd like built-ins to be callable from inside execute, follow #55087. If your problem turns out to be different, reply here and we can take another look. Thanks for the detailed report!
Activity
opencodejr commentedon Oct 28, 2026
Thanks for the clear report! I think this is a duplicate of #53623.
In v2, built-in tools like
shell,read,grep,glob,webfetchandwebsearchare top-level only by design: they're registered outside the Code Mode catalog, sotools.shell(...)insideexecuteisn't expected to work. The real problem is the one you describe: the Code Mode instructions never say built-ins stay top-level, and theUnknown toolhint sends the model tosearch, which can't find them. #53623 tracks exactly that.Possible duplicates and related issues, ordered from most to least likely:
tools.*insideexecute, andsearchcan't find them. A maintainer said the instructions will be adjusted.tools.read/tools.shellinsideexecute), already closed as a duplicate of "Code Mode" instructions are confusing Gemma-4-31B #53623.shellandreadbe called from insideexecute. That's the other half of your expected behaviour.tools.shellbeing unavailable inexecute, closed as expected behaviour.Until then, your workaround of calling
shelldirectly is the right one.The bot will close this issue as a duplicate in 1 day unless you reply explaining how your problem is different.
opencodejr commentedon Oct 29, 2026
We haven't heard back, so I'm closing this as a duplicate of #53623. That issue covers the same problem: the Code Mode instructions don't say that built-in tools like
shell,readandgrepare only called at the top level. Models then trytools.shell(...)insideexecute, getUnknown tool 'shell', and thesearchhint can't find the tool. Please follow #53623 for updates. PR #57627 proposes new wording for the prompt.If you'd like built-ins to be callable from inside
execute, follow #55087. If your problem turns out to be different, reply here and we can take another look. Thanks for the detailed report!