From b10b8dc8f8470bd1c23c046dead5923529634ac9 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sun, 22 Feb 2026 08:16:45 +0000 Subject: [PATCH] test(agents): reduce reset overhead in session visibility and hooks specs --- src/agents/openclaw-tools.sessions-visibility.e2e.test.ts | 2 +- src/agents/sessions-spawn-hooks.test.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/agents/openclaw-tools.sessions-visibility.e2e.test.ts b/src/agents/openclaw-tools.sessions-visibility.e2e.test.ts index bf959272460..193eaa1195f 100644 --- a/src/agents/openclaw-tools.sessions-visibility.e2e.test.ts +++ b/src/agents/openclaw-tools.sessions-visibility.e2e.test.ts @@ -35,7 +35,7 @@ function getSessionsHistoryTool(options?: { sandboxed?: boolean }) { function mockGatewayWithHistory( extra?: (req: { method?: string; params?: Record }) => unknown, ) { - callGatewayMock.mockReset(); + callGatewayMock.mockClear(); callGatewayMock.mockImplementation(async (opts: unknown) => { const req = opts as { method?: string; params?: Record }; const handled = extra?.(req); diff --git a/src/agents/sessions-spawn-hooks.test.ts b/src/agents/sessions-spawn-hooks.test.ts index 9dd9f089148..e38416af746 100644 --- a/src/agents/sessions-spawn-hooks.test.ts +++ b/src/agents/sessions-spawn-hooks.test.ts @@ -84,7 +84,7 @@ describe("sessions_spawn subagent lifecycle hooks", () => { hookRunnerMocks.runSubagentSpawned.mockClear(); hookRunnerMocks.runSubagentEnded.mockClear(); const callGatewayMock = getCallGatewayMock(); - callGatewayMock.mockReset(); + callGatewayMock.mockClear(); setSessionsSpawnConfigOverride({ session: { mainKey: "main",