1- import { resolveContextTokensForModel } from "../agents/context.js" ;
21import { DEFAULT_CONTEXT_TOKENS , DEFAULT_MODEL , DEFAULT_PROVIDER } from "../agents/defaults.js" ;
32import { resolveConfiguredModelRef } from "../agents/model-selection.js" ;
43import { hasPotentialConfiguredChannels } from "../channels/config-presence.js" ;
@@ -12,7 +11,6 @@ import {
1211 type SessionEntry ,
1312} from "../config/sessions.js" ;
1413import { listGatewayAgentsBasic } from "../gateway/agent-list.js" ;
15- import { classifySessionKey , resolveSessionModelRef } from "../gateway/session-utils.js" ;
1614import { resolveHeartbeatSummaryForAgent } from "../infra/heartbeat-summary.js" ;
1715import { peekSystemEvents } from "../infra/system-events.js" ;
1816import { parseAgentSessionKey } from "../routing/session-key.js" ;
@@ -21,6 +19,9 @@ import type { HeartbeatStatus, SessionStatus, StatusSummary } from "./status.typ
2119
2220let channelSummaryModulePromise : Promise < typeof import ( "../infra/channel-summary.js" ) > | undefined ;
2321let linkChannelModulePromise : Promise < typeof import ( "./status.link-channel.js" ) > | undefined ;
22+ let statusSummaryRuntimeModulePromise :
23+ | Promise < typeof import ( "./status.summary.runtime.js" ) >
24+ | undefined ;
2425
2526function 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+
3541const 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