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
Headless opencode run: any permission resolving to "ask" hangs forever, no timeout (three repro paths) #36762
In non-interactive opencode run (no TTY), any permission check that resolves to ask blocks forever: no prompt can render, there is no timeout, and the process looks busy while spending nothing. The only external signature is a message=asking log line (with --print-logs) and flat spend.
We hit this through three independent paths (all verified on 1.17.18):
Uncovered permission class: config has a permission.bash pattern map + skill: deny but no external_directory entry. A subagent reads a path outside the project → external_directory defaults to ask → hang.
Pipeline arbitration: top-level bash pattern map ending "*": "deny" with "npx *": "allow". A piped command like npx tsc | head -40 evaluates segments separately; mixed verdicts escalate to ask → hang.
Agent-level permission.bash maps not honored (agent-level edit IS honored) — falls back to ask → hang. Possibly its own bug; included here as an ask-path.
Expected: when stdin is not a TTY, ask should fail fast — auto-resolve to deny with a non-zero exit and a clear error, or be controllable via a flag (e.g. --non-interactive=deny). A documented list of every permission class that can reach ask would let operators close them all in config.
Related: #14473 described the external_directory case in server mode and was auto-closed by the staleness bot (which suggested opening a new issue); #7876 was cited there as the same root cause; #35073 covers the sync-subagent variant. This issue is the general headless opencode run case with the three repro paths above.
Side effect worth noting: with Anthropic-family models a >5-min hang expires the prompt cache, so even a recovered session pays a full-context cache re-write.
Activity
fix(adapters): pin opencode tool permissions and back the resume decl…
fix: declare OpenCode capability strategy (sipyourdrink-ltd#4099)
opencode runhangs forever when a subagent tool hits apermission=external_directoryask (v1.18.18) #43888 as a duplicate of this issuerekram1-node commentedon Aug 22, 2026
fixed in latest