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
A custom tool named question (.opencode/tools/question.ts) never runs in headless mode. It gets blocked by the built-in question permission, which headless mode denies unconditionally: packages/opencode/src/cli/cmd/run.ts injects { permission: "question", action: "deny", pattern: "*" } when not interactive. A user-defined tool that shares the built-in name inherits that deny, so it's silently killed. Naming the tool ask works around it.
Plugins
None
OpenCode version
1.18.16
Steps to reproduce
Add .opencode/tools/question.ts exporting a tool named question (Zod args).
Run: opencode run --format json --pure -- "call the question tool"
The tool is denied and never invoked (no output from the tool).
Screenshot and/or share link
No response
Operating System
Ubuntu 24.04 (aarch64)
Terminal
non-interactive (openshell sandbox exec -- sh -c, --no-tty)
If we make a custom tool with the same name as a built-in tool (like naming the file question.ts), it clashes. It just loads both, so now 2 tools exist. In headless mode, both the built-in tool and the custom tool get denied.
Before the fix, I want to ask: what should happen when we have 2 tools for the same name?
Let the custom tool override the built-in
Keep the built-in and skip the custom one (maybe with a warning)
Refuse to start and tell the user to rename it
Make it a config setting so the user decides ahead of time
I see this is already assigned, but I'd be happy to work on this one...
Activity
Piyush5784 commentedon Aug 28, 2026
I looked into the bug, and confirmed it exists.
If we make a custom tool with the same name as a built-in tool (like naming the file question.ts), it clashes. It just loads both, so now 2 tools exist. In headless mode, both the built-in tool and the custom tool get denied.
Before the fix, I want to ask: what should happen when we have 2 tools for the same name?
I see this is already assigned, but I'd be happy to work on this one...
thdxr commentedon Oct 11, 2026
Thanks for the report! OpenCode 2.0 is now out and development is focused on V2, so we're closing issues filed against OpenCode 1. Please upgrade (
opencode upgrade --major, details: https://anoma.ly/notes/opencode-2-0), and if this is still relevant on 2.0, reopen this issue or open a new one with your 2.0 version.— from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊