hooks: pass embedded sessionKey to after_tool_call context#32142
Closed
vincentkoc wants to merge 3 commits intomainfrom
Closed
hooks: pass embedded sessionKey to after_tool_call context#32142vincentkoc wants to merge 3 commits intomainfrom
vincentkoc wants to merge 3 commits intomainfrom
Conversation
f735f52 to
4bb4983
Compare
18 tasks
Member
Author
|
Consolidating this work into #32201 so Option A lands as one mergeable unit. #32201 combines:
Link: #32201 |
Member
Author
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
after_tool_callhook context withsessionKey: undefined.sessionKeythrough embedded tool handler params and pass it intorunAfterToolCall(...)context.toolCallId/runId) and no behavior changes outside embeddedafter_tool_callcontext propagation.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
User-visible / Behavior Changes
after_tool_callhook handlers now receivesessionKeyin embedded execution paths when available.Security Impact (required)
No)No)No)No)No)Yes, explain risk + mitigation:Repro + Verification
Environment
Steps
after_tool_callhook.sessionKeypresent in subscribe params.Expected
sessionKey.Actual
sessionKey: undefined.ctx.params.sessionKey.Evidence
Human Verification (required)
What you personally verified (not just CI), and how:
pnpm checkpnpm test -- src/agents/pi-embedded-subscribe.handlers.tools.test.tspnpm exec vitest run --config vitest.e2e.config.ts src/plugins/wired-hooks-after-tool-call.e2e.test.tssessionKey.pnpm test:e2esuite (current branch has unrelated pre-existing failures).Compatibility / Migration
Yes)No)No)Failure Recovery (if this breaks)
src/agents/pi-embedded-subscribe.handlers.types.tssrc/agents/pi-embedded-subscribe.handlers.tools.tssrc/plugins/wired-hooks-after-tool-call.e2e.test.tssessionKeyin embeddedafter_tool_callhook context.Risks and Mitigations
sessionKeypresence where they previously always sawundefined.