diff --git a/src/agents/pi-embedded-subscribe.handlers.tools.ts b/src/agents/pi-embedded-subscribe.handlers.tools.ts index 18dc11193f0..e41346a9e24 100644 --- a/src/agents/pi-embedded-subscribe.handlers.tools.ts +++ b/src/agents/pi-embedded-subscribe.handlers.tools.ts @@ -427,7 +427,7 @@ export async function handleToolExecutionEnd( .runAfterToolCall(hookEvent, { toolName, agentId: undefined, - sessionKey: undefined, + sessionKey: ctx.params.sessionKey, }) .catch((err) => { ctx.log.warn(`after_tool_call hook failed: tool=${toolName} error=${String(err)}`);