fix(opencode): cascade auto permissions to subagent sessions - #42310
fix(opencode): cascade auto permissions to subagent sessions#42310vladislav-miroshnikov wants to merge 1 commit into
Conversation
|
The following comment was made by an LLM, it may be inaccurate: Based on my search results, I found one potentially related PR: #37902 - This PR appears to address a similar issue with child/subagent session permission requests hanging. It may be related to or a predecessor of the current PR's fix for cascading auto permissions to subagent sessions. |
fe2a228 to
c5f66e8
Compare
|
@rekram1-node Updated on |
Issue for this PR
Fixes #41730
Type of change
What does this PR do?
When
opencode runspawns a subagent, permission requests belong to the child session. Filtering only for the root session leaves that subagent waiting forever.The run event loop now accepts permission requests from the attached root session and sessions whose
parentIDchain reaches that root. Proven descendants are cached. Requests from unrelated sessions in the same workspace remain untouched, so--autocannot approve another concurrent session's request.How did you verify your code works?
cd packages/opencode && bun test test/cli/run/run-process.test.ts— 16 pass, 0 failcd packages/opencode && bun test test/permission-task.test.ts— 21 pass, 0 failcd packages/opencode && bun typecheckThe subprocess matrix covers child auto-approval, child auto-rejection without
--auto, and an attach-mode negative case proving an unrelated session's pending permission is not answered.Checklist