anomalyco / anomalyco/opencode
question permission deny blocks same-named custom tool in headless mode
@rekram1-node is already working on this.
Since Aug 27, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Description
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)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.