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
fix: subagent permission asks hang indefinitely (sync subagents treated as interactive) #35073
Sync subagents (spawned via actor tool with action: "run") hang indefinitely when they trigger a permission ask. The permission prompt is never surfaced to the user because the subagent is treated as an interactive actor waiting for user confirmation, but no human is attached to reply.
Root Cause
In session/prompt.ts, the askNonInteractive check only marks actors as non-interactive if:
They are in SYSTEM_SPAWNED_AGENT_TYPES (checkpoint-writer, dream, distill), OR
They have background: true (only set for spawn action)
Sync subagents (run action) have background: false and are not in SYSTEM_SPAWNED_AGENT_TYPES, so they are treated as interactive. When they hit a permission ask, the system waits for a user reply that never comes.
Proposed Fix
All subagents should be marked as non-interactive because they have no attached human:
Related scenario that I believe is the same root cause but with a different policy expectation: --auto (auto-approve) does not propagate from the parent session to subagent sessions.
Reproduce:
Start opencode with --auto (or with "Auto Approve Permission" enabled).
Have the primary agent spawn a subagent (via the task/actor tool) that triggers a tool permission ask (e.g. a bash command not on the allow-list).
The subagent hangs indefinitely — the parent's --auto / auto-approve setting is not inherited, so the subagent waits for a human that isn't attached.
Why this matters beyond the reported hang:
The proposed fix in this issue (mark askActor.mode === "subagent" as non-interactive → fail with DeniedError) would resolve the hang, but for the --auto case it would turn a should-auto-approve path into a hard deny. The desired behavior when the parent session is in --auto mode is for the subagent to inherit the auto-approve setting and proceed, not to deny-and-fail.
Suggestion: when resolving the non-interactive classification, also propagate the parent session's approval mode (auto-approve / --auto) into the subagent session, so:
parent --auto ON → subagent auto-approves (no hang, no deny)
parent --auto OFF → subagent fails clean with DeniedError (current proposed behavior)
Activity
labulalala commentedon Jul 5, 2026
Related scenario that I believe is the same root cause but with a different policy expectation:
--auto(auto-approve) does not propagate from the parent session to subagent sessions.Reproduce:
--auto(or with "Auto Approve Permission" enabled).task/actortool) that triggers a tool permission ask (e.g. abashcommand not on the allow-list).--auto/ auto-approve setting is not inherited, so the subagent waits for a human that isn't attached.Why this matters beyond the reported hang:
The proposed fix in this issue (mark
askActor.mode === "subagent"as non-interactive → fail withDeniedError) would resolve the hang, but for the--autocase it would turn a should-auto-approve path into a hard deny. The desired behavior when the parent session is in--automode is for the subagent to inherit the auto-approve setting and proceed, not to deny-and-fail.Suggestion: when resolving the non-interactive classification, also propagate the parent session's approval mode (auto-approve /
--auto) into the subagent session, so:--autoON → subagent auto-approves (no hang, no deny)--autoOFF → subagent fails clean withDeniedError(current proposed behavior)Possibly related: #13715 (nested subagent permission asks also hang), #32388 (ACP variant).
github-actions commentedon Sep 4, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.