From af3db126d08ebdf7cf1b10a3dfebba13d9eb4f0a 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:49 -0400 Subject: [PATCH] fix: avoid blocking gateway snapshots on cortex history reads --- src/gateway/server/health-state.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gateway/server/health-state.ts b/src/gateway/server/health-state.ts index ee673426a33..848df148c04 100644 --- a/src/gateway/server/health-state.ts +++ b/src/gateway/server/health-state.ts @@ -1,5 +1,5 @@ import { resolveDefaultAgentId } from "../../agents/agent-scope.js"; -import { getLatestCortexCaptureHistoryEntrySync } from "../../agents/cortex-history.js"; +import { getCachedLatestCortexCaptureHistoryEntry } from "../../agents/cortex-history.js"; import { resolveAgentCortexConfig } from "../../agents/cortex.js"; import { getHealthSnapshot, type HealthSummary } from "../../commands/health.js"; import { STATE_DIR, createConfigIO, loadConfig } from "../../config/config.js"; @@ -22,7 +22,7 @@ export function buildGatewaySnapshot(): Snapshot { const defaultAgentId = resolveDefaultAgentId(cfg); const cortex = resolveAgentCortexConfig(cfg, defaultAgentId); const latestCortexCapture = cortex - ? getLatestCortexCaptureHistoryEntrySync({ agentId: defaultAgentId }) + ? getCachedLatestCortexCaptureHistoryEntry({ agentId: defaultAgentId }) : null; const mainKey = normalizeMainKey(cfg.session?.mainKey); const mainSessionKey = resolveMainSessionKey(cfg);