perf: lazy-load memory manager

This commit is contained in:
Peter Steinberger
2026-01-18 08:05:32 +00:00
parent de3b68740a
commit 2a86504723
3 changed files with 6 additions and 4 deletions

View File

@@ -6,7 +6,7 @@ import { probeGateway } from "../gateway/probe.js";
import { collectChannelStatusIssues } from "../infra/channels-status-issues.js";
import { resolveOsSummary } from "../infra/os-summary.js";
import { getTailnetHostname } from "../infra/tailscale.js";
import { MemoryIndexManager } from "../memory/manager.js";
import type { MemoryIndexManager } from "../memory/manager.js";
import { runExec } from "../process/exec.js";
import type { RuntimeEnv } from "../runtime.js";
import { getAgentLocalStatuses } from "./status.agent-local.js";
@@ -15,7 +15,7 @@ import { getStatusSummary } from "./status.summary.js";
import { getUpdateCheckResult } from "./status.update.js";
import { buildChannelsTable } from "./status-all/channels.js";
type MemoryStatusSnapshot = ReturnType<(typeof MemoryIndexManager)["prototype"]["status"]> & {
type MemoryStatusSnapshot = ReturnType<MemoryIndexManager["status"]> & {
agentId: string;
};
@@ -151,6 +151,7 @@ export async function scanStatus(
if (!memoryPlugin.enabled) return null;
if (memoryPlugin.slot !== "memory-core") return null;
const agentId = agentStatus.defaultId ?? "main";
const { MemoryIndexManager } = await import("../memory/manager.js");
const manager = await MemoryIndexManager.get({ cfg, agentId }).catch(() => null);
if (!manager) return null;
try {