Permission requests from child sessions do not get forwarded via ACP and hangs forever #8521

Closed
opened 2026-02-16 18:10:10 -05:00 by yindo · 4 comments
Owner

Originally created by @jonchun on GitHub (Feb 4, 2026).

Originally assigned to: @rekram1-node on GitHub.

Description

Summary

When OpenCode runs in ACP mode, permission requests originating from child sessions (e.g. Task subagents) are silently ignored. This causes those sessions to block indefinitely and appear frozen.

Problem

The ACP agent only handles permission requests for sessions it directly tracks. Child sessions created by Task subagents are not registered with the ACP session manager, so when they request permissions, the ACP agent drops the request without notifying the ACP client.

Expected Behavior

Permission requests from child sessions should be surfaced to the ACP client the same way as requests from the main session.

Impact
• Task subagents can deadlock
• No visible error or feedback to the user
• Difficult to diagnose without deep inspection

Plugins

No response

OpenCode version

OpenCode v1.1.51

Steps to reproduce

  1. Run OpenCode in ACP mode
  2. Trigger a Task subagent
    Use the Task tool to create a subagent that writes a test file to /tmp/opencode-permission-test.txt with the content "hello world", then reads it back and reports the contents.
    
  3. Observe the session freezing with no permission prompt

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Originally created by @jonchun on GitHub (Feb 4, 2026). Originally assigned to: @rekram1-node on GitHub. ### Description # Summary When OpenCode runs in ACP mode, permission requests originating from child sessions (e.g. Task subagents) are silently ignored. This causes those sessions to block indefinitely and appear frozen. # Problem The ACP agent only handles permission requests for sessions it directly tracks. Child sessions created by Task subagents are not registered with the ACP session manager, so when they request permissions, the ACP agent drops the request without notifying the ACP client. # Expected Behavior Permission requests from child sessions should be surfaced to the ACP client the same way as requests from the main session. Impact • Task subagents can deadlock • No visible error or feedback to the user • Difficult to diagnose without deep inspection ### Plugins _No response_ ### OpenCode version OpenCode v1.1.51 ### Steps to reproduce 1. Run OpenCode in ACP mode 2. Trigger a Task subagent ``` Use the Task tool to create a subagent that writes a test file to /tmp/opencode-permission-test.txt with the content "hello world", then reads it back and reports the contents. ``` 3. Observe the session freezing with no permission prompt ### Screenshot and/or share link _No response_ ### Operating System _No response_ ### Terminal _No response_
yindo added the bug label 2026-02-16 18:10:10 -05:00
yindo closed this issue 2026-02-16 18:10:10 -05:00
Author
Owner

@imadtg commented on GitHub (Feb 4, 2026):

this is also a bug in regular opencode TUI, subagent attempted access to non authorized files/folders just fail without prompting an authorization prompt like the main agent

@imadtg commented on GitHub (Feb 4, 2026): this is also a bug in regular opencode TUI, subagent attempted access to non authorized files/folders just fail without prompting an authorization prompt like the main agent
Author
Owner

@jonchun commented on GitHub (Feb 4, 2026):

this is also a bug in regular opencode TUI, subagent attempted access to non authorized files/folders just fail without prompting an authorization prompt like the main agent

I could swear I've seen permission prompts from the subagent bubble up to the TUI before, but perhaps there are different ways for this to happen. This bug report was specific to ACP, and the TUI issue sounds different: (At least it is auto-declining). In ACP's case, it just hangs forever which is an unacceptable user experience.

@jonchun commented on GitHub (Feb 4, 2026): > this is also a bug in regular opencode TUI, subagent attempted access to non authorized files/folders just fail without prompting an authorization prompt like the main agent I could swear I've seen permission prompts from the subagent bubble up to the TUI before, but perhaps there are different ways for this to happen. This bug report was specific to ACP, and the TUI issue sounds different: (At least it is auto-declining). In ACP's case, it just hangs forever which is an unacceptable user experience.
Author
Owner

@justfortheloveof commented on GitHub (Feb 4, 2026):

this is also a bug in regular opencode TUI, subagent attempted access to non authorized files/folders just fail without prompting an authorization prompt like the main agent

I could swear I've seen permission prompts from the subagent bubble up to the TUI before, but perhaps there are different ways for this to happen. This bug report was specific to ACP, and the TUI issue sounds different: (At least it is auto-declining). In ACP's case, it just hangs forever which is an unacceptable user experience.

I'm under the impression that the bug in the TUI is where a subagent spawned by a subagent tries to request for permissions, then it doesn't bubble up / is never shown in the TUI and the sub-subagent is stuck waiting for permission.

In other words:
Primary agent > Subagent (permission requests bubbles up to primary agent/session)
Primary agent > Subagent > Sub-subagent (permission requests do NOT bubble up, Sub-subagent stuck waiting for permission, but user cannot accept/deny)


On a related note, it's a bit annoying that the permission prompt is only shown in the parent session where if you are looking at a subagent session, eventually it asks for permissions and you have to go back to the parent session to take action.

@justfortheloveof commented on GitHub (Feb 4, 2026): > > this is also a bug in regular opencode TUI, subagent attempted access to non authorized files/folders just fail without prompting an authorization prompt like the main agent > > I could swear I've seen permission prompts from the subagent bubble up to the TUI before, but perhaps there are different ways for this to happen. This bug report was specific to ACP, and the TUI issue sounds different: (At least it is auto-declining). In ACP's case, it just hangs forever which is an unacceptable user experience. I'm under the impression that the bug in the TUI is where a subagent spawned by a subagent tries to request for permissions, then it doesn't bubble up / is never shown in the TUI and the sub-subagent is stuck waiting for permission. In other words: Primary agent > Subagent (permission requests bubbles up to primary agent/session) Primary agent > Subagent > Sub-subagent (permission requests do NOT bubble up, Sub-subagent stuck waiting for permission, but user cannot accept/deny) --- On a related note, it's a bit annoying that the permission prompt is only shown in the parent session where if you are looking at a subagent session, eventually it asks for permissions and you have to go back to the parent session to take action.
Author
Owner

@jonchun commented on GitHub (Feb 4, 2026):

On a related note, it's a bit annoying that the permission prompt is only shown in the parent session where if you are looking at a subagent session, eventually it asks for permissions and you have to go back to the parent session to take action.

100% agreed. it gets me every time.

I'm under the impression that the bug in the TUI is where a subagent spawned by a subagent tries to request for permissions, then it doesn't bubble up / is never shown in the TUI and the sub-subagent is stuck waiting for permission.

that makes sense. I think my PR for ACP didn't consider sub-subagents and I don't think that would work in that case. would need to walk up the parent recursively.

@jonchun commented on GitHub (Feb 4, 2026): > On a related note, it's a bit annoying that the permission prompt is only shown in the parent session where if you are looking at a subagent session, eventually it asks for permissions and you have to go back to the parent session to take action. 100% agreed. it gets me every time. > I'm under the impression that the bug in the TUI is where a subagent spawned by a subagent tries to request for permissions, then it doesn't bubble up / is never shown in the TUI and the sub-subagent is stuck waiting for permission. that makes sense. I think my PR for ACP didn't consider sub-subagents and I don't think that would work in that case. would need to walk up the parent recursively.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#8521