Repository navigation
fix(coding-agent): enforce parent extension policy for subagents - #141
Merged
Merged
Conversation
Pepps233
approved these changes
Aug 28, 2026
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.
Summary
Child sessions do not load parent extensions, so spawning a child could bypass execution-mutating hooks registered by the root session. This PR makes controller-bound spawning fail before child creation whenever the current parent extension runner contains an incompatible hook.
Reasoning
The root session remains the authority for extension policy, while the controller owns child admission. Passing a private callback between those boundaries lets every spawn inspect the current extension runner, including after reloads, without exposing runner internals or copying parent extensions into children. Checking both tool entry and controller admission prevents side effects before rejection while preserving unbound programmatic controllers and observation-only hooks.
Changes
resources_discover,input,context,before_agent_start,before_provider_request,before_provider_headers,session_before_compact,tool_call,tool_result, andmessage_endhooks.Testing
node ../../node_modules/vitest/dist/cli.js --run test/suite/subagent-registration.test.tsnode ../../node_modules/vitest/dist/cli.js --run test/suite/subagent-services.test.ts test/suite/subagent-registration.test.ts test/suite/subagent-coordination.test.ts test/suite/subagent-parent-messaging.test.ts test/subagent-controller.test.tsnpm run check