Skip to content

Conversation

@jonchun
Copy link

@jonchun jonchun commented Feb 4, 2026

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

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.

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.
@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2026

The following comment was made by an LLM, it may be inaccurate:

No duplicate PRs found

@jonchun
Copy link
Author

jonchun commented Feb 4, 2026

I think the checks are flaky/unrelated to my changes.

Just a note from a previous thread - I wonder if we need to address sub-subagents. Right now I believe this only covers subagents and we will have the same behavior from sub-subagents. Do we want to fix this so it recursively walks up the .parent until it finds a valid session?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant