Skip to content

Commit a608d09

Browse files
committed
Status: lazy-load summary session helpers
1 parent 4ab016a commit a608d09

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export { resolveContextTokensForModel } from "../agents/context.js";
2+
export { classifySessionKey, resolveSessionModelRef } from "../gateway/session-utils.js";

src/commands/status.summary.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { resolveContextTokensForModel } from "../agents/context.js";
21
import { DEFAULT_CONTEXT_TOKENS, DEFAULT_MODEL, DEFAULT_PROVIDER } from "../agents/defaults.js";
32
import { resolveConfiguredModelRef } from "../agents/model-selection.js";
43
import { hasPotentialConfiguredChannels } from "../channels/config-presence.js";
@@ -12,7 +11,6 @@ import {
1211
type SessionEntry,
1312
} from "../config/sessions.js";
1413
import { listGatewayAgentsBasic } from "../gateway/agent-list.js";
15-
import { classifySessionKey, resolveSessionModelRef } from "../gateway/session-utils.js";
1614
import { resolveHeartbeatSummaryForAgent } from "../infra/heartbeat-summary.js";
1715
import { peekSystemEvents } from "../infra/system-events.js";
1816
import { parseAgentSessionKey } from "../routing/session-key.js";
@@ -21,6 +19,9 @@ import type { HeartbeatStatus, SessionStatus, StatusSummary } from "./status.typ
2119

2220
let channelSummaryModulePromise: Promise<typeof import("../infra/channel-summary.js")> | undefined;
2321
let linkChannelModulePromise: Promise<typeof import("./status.link-channel.js")> | undefined;
22+
let statusSummaryRuntimeModulePromise:
23+
| Promise<typeof import("./status.summary.runtime.js")>
24+
| undefined;
2425

2526
function loadChannelSummaryModule() {
2627
channelSummaryModulePromise ??= import("../infra/channel-summary.js");
@@ -32,6 +33,11 @@ function loadLinkChannelModule() {
3233
return linkChannelModulePromise;
3334
}
3435

36+
function loadStatusSummaryRuntimeModule() {
37+
statusSummaryRuntimeModulePromise ??= import("./status.summary.runtime.js");
38+
return statusSummaryRuntimeModulePromise;
39+
}
40+
3541
const buildFlags = (entry?: SessionEntry): string[] => {
3642
if (!entry) {
3743
return [];
@@ -97,6 +103,8 @@ export async function getStatusSummary(
97103
} = {},
98104
): Promise<StatusSummary> {
99105
const { includeSensitive = true } = options;
106+
const { classifySessionKey, resolveContextTokensForModel, resolveSessionModelRef } =
107+
await loadStatusSummaryRuntimeModule();
100108
const cfg = options.config ?? loadConfig();
101109
const needsChannelPlugins = hasPotentialConfiguredChannels(cfg);
102110
const linkContext = needsChannelPlugins

0 commit comments

Comments
 (0)