AI-assisted: Gateway hook event routing respects target agent session#39046
AI-assisted: Gateway hook event routing respects target agent session#39046vincentkoc wants to merge 2 commits into
Conversation
|
Codex review: found issues before merge. Reviewed July 5, 2026, 5:24 AM ET / 09:24 UTC. Summary PR surface: Source +15, Tests +17. Total +32 across 2 files. Reproducibility: yes. for the PR defect by source comparison: this branch infers the hook event target from sessionKey when agentId is omitted, while current main tests enforce omitted agentId as the default target. The original explicit-agent leak is no longer present in current main or v2026.6.11. Review metrics: 1 noteworthy metric.
Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Maintainer decision needed
Security Review findings
Review detailsBest possible solution: Keep the behavior from #73228 and v2026.6.11 as canonical; a maintainer should either close this protected draft as superseded or refresh it without the sessionKey-derived target fallback. Do we have a high-confidence way to reproduce the issue? Yes for the PR defect by source comparison: this branch infers the hook event target from sessionKey when agentId is omitted, while current main tests enforce omitted agentId as the default target. The original explicit-agent leak is no longer present in current main or v2026.6.11. Is this the best way to solve the issue? No for merging this branch as-is. The central fix is already represented by the merged replacement, and the remaining sessionKey fallback should either be dropped to match current policy or explicitly sponsored as a separate policy change. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 153ee2abbaff; fix evidence: release v2026.6.11, commit 6f38425e5c18. Label changesLabel justifications:
Evidence reviewedPR surface: Source +15, Tests +17. Total +32 across 2 files. View PR surface stats
Security concerns:
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
Review history (4 earlier review cycles)
|
|
ClawSweeper PR egg 🔥 Warming up: real-behavior proof passed; findings, security review, or rank-up moves are still in progress. Hatch commandComment Hatchability rules:
What is this egg doing here?
|
|
Closing as superseded by #73228, merged in That canonical change routes hook completion and error events to the target agent main session in Thanks @vincentkoc for identifying and implementing the isolation fix. The maintained version is now #73228. |
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.