Repository navigation
Conversation
Contributor
|
Thanks for tracking this down and for the clear write-up and test! I think this duplicates #63614. It fixes the same bug (#61238, which #63690 was closed as a duplicate of): there, a session
If you think #63614 misses something you covered here, it would help a lot to review or test it and comment there. One example is the |
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 free
to 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
Closes #61238
Type of change
What does this PR do?
Child sessions inherit the parent's
browser: allowrule, but the attachment is keyed by the parent's session ID, so browser calls from a child always return[browser.disconnected]. Agents without Code Mode, likeexplore, still got all browser tools as direct tools.The browser plugin now registers a
sessioncontexthook that drops its direct tools when the requesting session has no attachment (connecting or connected). Attached sessions are unchanged. I kept it in the plugin instead of changing how children inherit permissions, since that inheritance is intentional for other host rules.Tools reached through
executeare not filtered here; they still return the existing disconnected error.#63002 also stops grants leaking to subagents as part of a much larger browser change. This is a small standalone fix for #61238 in the meantime; feel free to close it if #63002 lands first.
How did you verify your code works?
packages/core/test/browser-attach.test.ts: after attaching, a child created withparentIDstill inherits the grant, but its context request keeps only non-browser tools while the parent keeps them all. It fails without the change.bun testinpackages/plugin-browser,browser-attach/tool-registry/session-model-requesttests inpackages/core, andbun typecheckin both packages pass.Checklist