diff --git a/src/auto-reply/reply/commands-status.ts b/src/auto-reply/reply/commands-status.ts index 9d416d3f291..08aff7e0565 100644 --- a/src/auto-reply/reply/commands-status.ts +++ b/src/auto-reply/reply/commands-status.ts @@ -1,9 +1,3 @@ -import type { OpenClawConfig } from "../../config/config.js"; -import type { SessionEntry, SessionScope } from "../../config/sessions.js"; -import type { MediaUnderstandingDecision } from "../../media-understanding/types.js"; -import type { ElevatedLevel, ReasoningLevel, ThinkLevel, VerboseLevel } from "../thinking.js"; -import type { ReplyPayload } from "../types.js"; -import type { CommandContext } from "./commands-types.js"; import { resolveAgentDir, resolveDefaultAgentId, @@ -15,14 +9,20 @@ import { resolveInternalSessionKey, resolveMainSessionAlias, } from "../../agents/tools/sessions-helpers.js"; +import type { OpenClawConfig } from "../../config/config.js"; +import type { SessionEntry, SessionScope } from "../../config/sessions.js"; import { logVerbose } from "../../globals.js"; import { formatUsageWindowSummary, loadProviderUsageSummary, resolveUsageProviderId, } from "../../infra/provider-usage.js"; +import type { MediaUnderstandingDecision } from "../../media-understanding/types.js"; import { normalizeGroupActivation } from "../group-activation.js"; import { buildStatusMessage } from "../status.js"; +import type { ElevatedLevel, ReasoningLevel, ThinkLevel, VerboseLevel } from "../thinking.js"; +import type { ReplyPayload } from "../types.js"; +import type { CommandContext } from "./commands-types.js"; import { getFollowupQueueDepth, resolveQueueSettings } from "./queue.js"; import { resolveSubagentLabel } from "./subagents-utils.js"; diff --git a/src/auto-reply/reply/commands-subagents-spawn.test.ts b/src/auto-reply/reply/commands-subagents-spawn.test.ts index 9dca5f91eea..cc8adf05e6c 100644 --- a/src/auto-reply/reply/commands-subagents-spawn.test.ts +++ b/src/auto-reply/reply/commands-subagents-spawn.test.ts @@ -1,6 +1,6 @@ import { beforeEach, describe, expect, it, vi } from "vitest"; -import type { SpawnSubagentResult } from "../../agents/subagent-spawn.js"; import { resetSubagentRegistryForTests } from "../../agents/subagent-registry.js"; +import type { SpawnSubagentResult } from "../../agents/subagent-spawn.js"; const hoisted = vi.hoisted(() => { const spawnSubagentDirectMock = vi.fn(); diff --git a/src/auto-reply/reply/commands-subagents.ts b/src/auto-reply/reply/commands-subagents.ts index 0535ddb68fa..f56a9ed43e6 100644 --- a/src/auto-reply/reply/commands-subagents.ts +++ b/src/auto-reply/reply/commands-subagents.ts @@ -1,8 +1,7 @@ import crypto from "node:crypto"; -import type { SubagentRunRecord } from "../../agents/subagent-registry.js"; -import type { CommandHandler } from "./commands-types.js"; import { AGENT_LANE_SUBAGENT } from "../../agents/lanes.js"; import { abortEmbeddedPiRun } from "../../agents/pi-embedded.js"; +import type { SubagentRunRecord } from "../../agents/subagent-registry.js"; import { clearSubagentRunSteerRestart, listSubagentRunsForRequester, @@ -36,6 +35,7 @@ import { } from "../../shared/subagents-format.js"; import { INTERNAL_MESSAGE_CHANNEL } from "../../utils/message-channel.js"; import { stopSubagentsForRequester } from "./abort.js"; +import type { CommandHandler } from "./commands-types.js"; import { clearSessionQueues } from "./queue.js"; import { formatRunLabel, formatRunStatus, sortSubagentRuns } from "./subagents-utils.js"; diff --git a/src/auto-reply/status.test.ts b/src/auto-reply/status.test.ts index 0bf4bb4b118..ad094713f7f 100644 --- a/src/auto-reply/status.test.ts +++ b/src/auto-reply/status.test.ts @@ -13,7 +13,9 @@ import { } from "./status.js"; const { listPluginCommands } = vi.hoisted(() => ({ - listPluginCommands: vi.fn(() => []), + listPluginCommands: vi.fn( + (): Array<{ name: string; description: string; pluginId: string }> => [], + ), })); vi.mock("../plugins/commands.js", () => ({ diff --git a/src/auto-reply/status.ts b/src/auto-reply/status.ts index 7b147053a69..56d8eabc598 100644 --- a/src/auto-reply/status.ts +++ b/src/auto-reply/status.ts @@ -1,15 +1,12 @@ import fs from "node:fs"; -import type { SkillCommandSpec } from "../agents/skills.js"; -import type { OpenClawConfig } from "../config/config.js"; -import type { MediaUnderstandingDecision } from "../media-understanding/types.js"; -import type { CommandCategory } from "./commands-registry.types.js"; -import type { ElevatedLevel, ReasoningLevel, ThinkLevel, VerboseLevel } from "./thinking.js"; import { lookupContextTokens } from "../agents/context.js"; import { DEFAULT_CONTEXT_TOKENS, DEFAULT_MODEL, DEFAULT_PROVIDER } from "../agents/defaults.js"; import { resolveModelAuthMode } from "../agents/model-auth.js"; import { resolveConfiguredModelRef } from "../agents/model-selection.js"; import { resolveSandboxRuntimeStatus } from "../agents/sandbox.js"; +import type { SkillCommandSpec } from "../agents/skills.js"; import { derivePromptTokens, normalizeUsage, type UsageLike } from "../agents/usage.js"; +import type { OpenClawConfig } from "../config/config.js"; import { resolveMainSessionKey, resolveSessionFilePath, @@ -19,6 +16,7 @@ import { } from "../config/sessions.js"; import { formatTimeAgo } from "../infra/format-time/format-relative.ts"; import { resolveCommitHash } from "../infra/git-commit.js"; +import type { MediaUnderstandingDecision } from "../media-understanding/types.js"; import { listPluginCommands } from "../plugins/commands.js"; import { resolveAgentIdFromSessionKey } from "../routing/session-key.js"; import { @@ -41,8 +39,13 @@ import { listChatCommandsForConfig, type ChatCommandDefinition, } from "./commands-registry.js"; +import type { CommandCategory } from "./commands-registry.types.js"; +import type { ElevatedLevel, ReasoningLevel, ThinkLevel, VerboseLevel } from "./thinking.js"; -type AgentConfig = Partial["defaults"]>>; +type AgentDefaults = NonNullable["defaults"]>; +type AgentConfig = Partial & { + model?: AgentDefaults["model"] | string; +}; export const formatTokenCount = formatTokenCountShared; @@ -72,7 +75,7 @@ type StatusArgs = { usageLine?: string; timeLine?: string; queue?: QueueStatus; - mediaDecisions?: MediaUnderstandingDecision[]; + mediaDecisions?: ReadonlyArray; subagentsLine?: string; includeTranscriptUsage?: boolean; now?: number;