Uh oh!
There was an error while loading. Please reload this page.
fix(opencode): cascade auto permissions to subagent sessions - #42310
Open
vladislav-miroshnikov wants to merge 2 commits into
Open
fix(opencode): cascade auto permissions to subagent sessions#42310vladislav-miroshnikov wants to merge 2 commits into
vladislav-miroshnikov wants to merge 2 commits into
Conversation
Contributor
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. |
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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