[PR #12136] fix(acp): handle permission requests from child sessions #14082

Open
opened 2026-02-16 18:18:53 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/12136

State: open
Merged: No


When Task subagents create child sessions, they are not registered in the ACP session manager. This caused permission requests from those sessions to be silently ignored, freezing the session indefinitely.

What does this PR do?

Fixes #12133. Now fetches session info from SDK when the session is not found in the manager, allowing permission requests from child sessions to be properly forwarded to the ACP client.

How did you verify your code works?

I created a super simple ACP test client in Python that tests permission requests from Task subagents are properly forwarded to the ACP client (which auto-accepts the permission) by spawning 4 parallel OpenCode ACP processes (2 prod, 2 dev) with two prompts:
Baseline:

What is 2+2?

Test:

Use the Task tool to create a subagent that writes a test file to /tmp/test.txt with the content
"hello world", then reads it back and reports the contents.
======================================================================
SUMMARY
======================================================================
Name       Command                   Status     Perms  Child  Time
----------------------------------------------------------------------
prod-simple opencode acp              OK         0      0      3.5s
prod-perm  opencode acp              FAIL: Timeout 0      0      120.9s
dev-simple bun run dev acp           OK         0      0      7.3s
dev-perm   bun run dev acp           OK         2      2      20.4s
----------------------------------------------------------------------
Passed: 3/4
With child session permissions: 1/4

The prod-perm is EXPECTED to fail and time out (because the permissions never get forwarded, thus the ACP client just doesn't ever know it needs to do something)

test_acp.py

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/12136 **State:** open **Merged:** No --- When Task subagents create child sessions, they are not registered in the ACP session manager. This caused permission requests from those sessions to be silently ignored, freezing the session indefinitely. ### What does this PR do? Fixes #12133. Now fetches session info from SDK when the session is not found in the manager, allowing permission requests from child sessions to be properly forwarded to the ACP client. ### How did you verify your code works? I created a super simple ACP test client in Python that tests permission requests from Task subagents are properly forwarded to the ACP client (which auto-accepts the permission) by spawning 4 parallel OpenCode ACP processes (2 prod, 2 dev) with two prompts: **Baseline:** ``` What is 2+2? ``` **Test:** ``` Use the Task tool to create a subagent that writes a test file to /tmp/test.txt with the content "hello world", then reads it back and reports the contents. ``` ``` ====================================================================== SUMMARY ====================================================================== Name Command Status Perms Child Time ---------------------------------------------------------------------- prod-simple opencode acp OK 0 0 3.5s prod-perm opencode acp FAIL: Timeout 0 0 120.9s dev-simple bun run dev acp OK 0 0 7.3s dev-perm bun run dev acp OK 2 2 20.4s ---------------------------------------------------------------------- Passed: 3/4 With child session permissions: 1/4 ``` The `prod-perm` is EXPECTED to fail and time out (because the permissions never get forwarded, thus the ACP client just doesn't ever know it needs to do something) [test_acp.py](https://github.com/user-attachments/files/25074621/test_acp.py)
yindo added the pull-request label 2026-02-16 18:18:53 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#14082