mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-30 02:22:25 +00:00
Status: lazy-load summary session helpers
This commit is contained in:
2
src/commands/status.summary.runtime.ts
Normal file
2
src/commands/status.summary.runtime.ts
Normal file
@@ -0,0 +1,2 @@
|
||||
export { resolveContextTokensForModel } from "../agents/context.js";
|
||||
export { classifySessionKey, resolveSessionModelRef } from "../gateway/session-utils.js";
|
||||
@@ -1,4 +1,3 @@
|
||||
import { resolveContextTokensForModel } from "../agents/context.js";
|
||||
import { DEFAULT_CONTEXT_TOKENS, DEFAULT_MODEL, DEFAULT_PROVIDER } from "../agents/defaults.js";
|
||||
import { resolveConfiguredModelRef } from "../agents/model-selection.js";
|
||||
import { hasPotentialConfiguredChannels } from "../channels/config-presence.js";
|
||||
@@ -12,7 +11,6 @@ import {
|
||||
type SessionEntry,
|
||||
} from "../config/sessions.js";
|
||||
import { listGatewayAgentsBasic } from "../gateway/agent-list.js";
|
||||
import { classifySessionKey, resolveSessionModelRef } from "../gateway/session-utils.js";
|
||||
import { resolveHeartbeatSummaryForAgent } from "../infra/heartbeat-summary.js";
|
||||
import { peekSystemEvents } from "../infra/system-events.js";
|
||||
import { parseAgentSessionKey } from "../routing/session-key.js";
|
||||
@@ -21,6 +19,9 @@ import type { HeartbeatStatus, SessionStatus, StatusSummary } from "./status.typ
|
||||
|
||||
let channelSummaryModulePromise: Promise<typeof import("../infra/channel-summary.js")> | undefined;
|
||||
let linkChannelModulePromise: Promise<typeof import("./status.link-channel.js")> | undefined;
|
||||
let statusSummaryRuntimeModulePromise:
|
||||
| Promise<typeof import("./status.summary.runtime.js")>
|
||||
| undefined;
|
||||
|
||||
function loadChannelSummaryModule() {
|
||||
channelSummaryModulePromise ??= import("../infra/channel-summary.js");
|
||||
@@ -32,6 +33,11 @@ function loadLinkChannelModule() {
|
||||
return linkChannelModulePromise;
|
||||
}
|
||||
|
||||
function loadStatusSummaryRuntimeModule() {
|
||||
statusSummaryRuntimeModulePromise ??= import("./status.summary.runtime.js");
|
||||
return statusSummaryRuntimeModulePromise;
|
||||
}
|
||||
|
||||
const buildFlags = (entry?: SessionEntry): string[] => {
|
||||
if (!entry) {
|
||||
return [];
|
||||
@@ -97,6 +103,8 @@ export async function getStatusSummary(
|
||||
} = {},
|
||||
): Promise<StatusSummary> {
|
||||
const { includeSensitive = true } = options;
|
||||
const { classifySessionKey, resolveContextTokensForModel, resolveSessionModelRef } =
|
||||
await loadStatusSummaryRuntimeModule();
|
||||
const cfg = options.config ?? loadConfig();
|
||||
const needsChannelPlugins = hasPotentialConfiguredChannels(cfg);
|
||||
const linkContext = needsChannelPlugins
|
||||
|
||||
Reference in New Issue
Block a user