mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-13 19:10:39 +00:00
test: assert sessionKey in embedded after tool call hook context
This commit is contained in:
@@ -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 () => {
|
||||
|
||||
Reference in New Issue
Block a user