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
Auto-approve permissions (--auto) do not cascade down to subagents after running 'opencode run --auto' #41730
When you run opencode run --auto, the auto-approve permissions do not cascade down to subagents.
I conducted two tests:
Test 1
I have a file in my workspace called test.txt, which just contains the word purple in it. I have set 'edit': 'ask' for permissions in my opencode.json file.
The following command hangs indefinitely because the subagent is forever waiting for user permission:
opencode run --auto "Spawn a subagent to edit the test.txt file and append the words 'monkey' and 'dishwasher' to the text."
Running through the main agentic process works:
opencode run --auto "Edit the test.txt file and append the words 'monkey' and 'dishwasher' to the text."
Test 2
I want to create a file in /tmp. By default external_directory permissions are set to ask.
Using the main agentic process works:
opencode run --auto "Create a file in /tmp called test.txt and write 'This is a test' in it"
But using subagents will cause the command to hang indefinitely because the subagent is waiting for permission:
opencode run --auto "Spawn a subagent to create a file in /tmp called test.txt and write 'This is a test' in it"
Also if it's too risky cascading auto-approval to subagents, it might be an idea to add a note about this in the documentation. As currently written, the docs make it sounds like --auto will automatically approve anything that is not explicitly denied, which is misleading when it comes to subagents:
@rekram1-node#43675 covers children created during the run, but its thread reports a remaining hang when task_id reuses an earlier child and no session.created event fires. I'd narrow #42310 to that case: keep the merged event tracking and follow parentID only when the child isn't already known. Unrelated sessions would still stay outside the approval tree.
Thanks for the report! OpenCode 2.0 is now out and development is focused on V2, so we're closing issues filed against OpenCode 1. Please upgrade (opencode upgrade --major, details: https://anoma.ly/notes/opencode-2-0), and if this is still relevant on 2.0, reopen this issue or open a new one with your 2.0 version.
Activity
github-actions commentedon Aug 11, 2026
This issue might be a duplicate of existing issues. Please check:
--autonot propagating to subagents, causing indefinite hangs on permission promptsdanmacpherson commentedon Aug 11, 2026
Also if it's too risky cascading auto-approval to subagents, it might be an idea to add a note about this in the documentation. As currently written, the docs make it sounds like
--autowill automatically approve anything that is not explicitly denied, which is misleading when it comes to subagents:https://opencode.ai/docs/permissions/#auto-mode
vladislav-miroshnikov commentedon Sep 9, 2026
@rekram1-node #43675 covers children created during the run, but its thread reports a remaining hang when
task_idreuses an earlier child and nosession.createdevent fires. I'd narrow #42310 to that case: keep the merged event tracking and followparentIDonly when the child isn't already known. Unrelated sessions would still stay outside the approval tree.Would that be a useful scope for this PR?
thdxr commentedon Oct 11, 2026
Thanks for the report! OpenCode 2.0 is now out and development is focused on V2, so we're closing issues filed against OpenCode 1. Please upgrade (
opencode upgrade --major, details: https://anoma.ly/notes/opencode-2-0), and if this is still relevant on 2.0, reopen this issue or open a new one with your 2.0 version.— from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊