fix: avoid blocking gateway snapshots on cortex history reads

This commit is contained in:
Marc J Saint-jour 2026-03-12 20:21:49 -04:00
parent dfe9ab163a
commit af3db126d0

View File

@ -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);