From 4f692398376f806eba2b7b399bfc2b6093263176 Mon Sep 17 00:00:00 2001 From: Marc J Saint-jour <82672745+Junebugg1214@users.noreply.github.com> Date: Thu, 12 Mar 2026 20:21:50 -0400 Subject: [PATCH] fix: avoid blocking gateway snapshots on cortex history reads --- src/gateway/server/health-state.test.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gateway/server/health-state.test.ts b/src/gateway/server/health-state.test.ts index d6ebeaf1a94..a62d6df0b9f 100644 --- a/src/gateway/server/health-state.test.ts +++ b/src/gateway/server/health-state.test.ts @@ -9,7 +9,7 @@ const listSystemPresenceMock = vi.hoisted(() => vi.fn()); const resolveGatewayAuthMock = vi.hoisted(() => vi.fn()); const getUpdateAvailableMock = vi.hoisted(() => vi.fn()); const resolveAgentCortexConfigMock = vi.hoisted(() => vi.fn()); -const getLatestCortexCaptureHistoryEntrySyncMock = vi.hoisted(() => vi.fn()); +const getCachedLatestCortexCaptureHistoryEntryMock = vi.hoisted(() => vi.fn()); vi.mock("../../config/config.js", () => ({ STATE_DIR: "/tmp/openclaw-state", @@ -51,7 +51,7 @@ vi.mock("../../agents/cortex.js", () => ({ })); vi.mock("../../agents/cortex-history.js", () => ({ - getLatestCortexCaptureHistoryEntrySync: getLatestCortexCaptureHistoryEntrySyncMock, + getCachedLatestCortexCaptureHistoryEntry: getCachedLatestCortexCaptureHistoryEntryMock, })); import { buildGatewaySnapshot } from "./health-state.js"; @@ -78,7 +78,7 @@ describe("buildGatewaySnapshot", () => { maxChars: 1500, graphPath: ".cortex/context.json", }); - getLatestCortexCaptureHistoryEntrySyncMock.mockReturnValue({ + getCachedLatestCortexCaptureHistoryEntryMock.mockReturnValue({ agentId: "main", captured: true, score: 0.7,