AI-assisted: Gateway hook event routing respects target agent session#80
Open
BingqingLyu wants to merge 2 commits into
Open
AI-assisted: Gateway hook event routing respects target agent session#80BingqingLyu wants to merge 2 commits into
BingqingLyu wants to merge 2 commits into
Conversation
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
hooks-targeted events stay out of the default session.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
User-visible / Behavior Changes
Hook completion/error summaries now appear only in the target agent's main session instead of leaking into the default agent session.
Security Impact (required)
No)No)No)No)Yes)Yes, explain risk + mitigation:This reduces data exposure by scoping hook-generated system events to the intended agent session. No broader data access was added.
Repro + Verification
Environment
mainagent andhooksagentSteps
agentIdofhooks./hooks/agentwith a non-delivered hook run.agent:main:mainandagent:hooks:main.Expected
Actual
Evidence
Attach at least one:
Human Verification (required)
What you personally verified (not just CI), and how:
agentId: "hooks", agent-scoped requestsessionKey, allowed-agent enforcement, wake hooks still landing in the default main session.Compatibility / Migration
Yes)No)No)Failure Recovery (if this breaks)
src/gateway/server/hooks.tsandsrc/gateway/server.hooks.test.tsRisks and Mitigations
AI-assisted: yes. Fully tested locally for the targeted hook suite and validated with
pnpm build.