anomalyco / anomalyco/opencode

question permission deny blocks same-named custom tool in headless mode

Open
#45,531 1 comment 0 reactions 1 assignee View on GitHub

@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
  1. Add .opencode/tools/question.ts exporting a tool named question (Zod args).
  2. Run: opencode run --format json --pure -- "call the question tool"
  3. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.