From 4bb498341596a577dfd9b969caa8b82308bd3c5e Mon Sep 17 00:00:00 2001 From: Vincent Koc Date: Mon, 2 Mar 2026 12:23:41 -0800 Subject: [PATCH] test: assert sessionKey in embedded after tool call hook context --- src/plugins/wired-hooks-after-tool-call.e2e.test.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/wired-hooks-after-tool-call.e2e.test.ts b/src/plugins/wired-hooks-after-tool-call.e2e.test.ts index 8ec506a5d33..022a209f179 100644 --- a/src/plugins/wired-hooks-after-tool-call.e2e.test.ts +++ b/src/plugins/wired-hooks-after-tool-call.e2e.test.ts @@ -114,7 +114,7 @@ describe("after_tool_call hook wiring", () => { const event = firstCall?.[0] as | { toolName?: string; params?: unknown; error?: unknown; durationMs?: unknown } | undefined; - const context = firstCall?.[1] as { toolName?: string } | undefined; + const context = firstCall?.[1] as { toolName?: string; sessionKey?: string } | undefined; expect(event).toBeDefined(); expect(context).toBeDefined(); if (!event || !context) { @@ -125,6 +125,7 @@ describe("after_tool_call hook wiring", () => { expect(event.error).toBeUndefined(); expect(typeof event.durationMs).toBe("number"); expect(context.toolName).toBe("read"); + expect(context.sessionKey).toBe("test-session"); }); it("includes error in after_tool_call event on tool failure", async () => {