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
Non-interactive opencode run hangs forever when a subagent tool hits a permission=external_directory ask (v1.18.18) #43888
Non-interactive opencode run hangs forever when a subagent tool hits a permission=external_directory ask (v1.18.18)
Environment
OpenCode version: v1.18.18
Command: opencode run --format json --auto (non-interactive mode)
Working directory: Anchored to a directory outside the project (via --dir or PWD)
Reproduction Steps
Run opencode run --format json --auto with the current working directory set to a path outside the project root (e.g., /tmp/ai-harness-*/workspace).
During execution, a subagent delegates and uses a file tool (e.g., Write) to touch a path classified as an external directory.
The permission resolution yields action=ask for permission=external_directory.
Observe the log line: asking id=per_… permission=external_directory.
Observed Behavior
The tool part stays in status:"running" state indefinitely.
The parent OpenCode run never times out; it hangs forever until the process is killed externally.
Top-level sessions can resolve their own ask permissions via OPENCODE_ASK_ALLOW env var, but subagent delegation hangs because the non-interactive mode cannot prompt for user input.
No error is surfaced; the child process never exits.
Expected Behavior
In non-interactive mode, ask permissions should:
Time out after a reasonable period.
Auto-deny and surface an error to continue execution.
Or respect a OPENCODE_ASK_ALLOW/OPENCODE_ASK_DENY pattern consistent across top-level and subagent contexts.
Activity
github-actions commentedon Aug 21, 2026
This issue might be a duplicate of existing issues. Please check:
opencode run: any permission resolving to "ask" hangs forever, no timeout (three repro paths) #36762: Headlessopencode run: any permission resolving to "ask" hangs forever, no timeout — covers the same root cause of non-interactive mode hanging onaskpermissionsopencode run --autohangs indefinitely when a Task subagent requests permission — same scenario with--autoflag and subagent delegation--auto) do not cascade down to subagents — directly related to the cascading permission issue you describeopencode run: any permission resolving to "ask" hangs forever, no timeout (three repro paths) #36762