diff --git a/src/plugin-handlers/agent-config-handler.ts b/src/plugin-handlers/agent-config-handler.ts index b8c7a9ee6..e8c038850 100644 --- a/src/plugin-handlers/agent-config-handler.ts +++ b/src/plugin-handlers/agent-config-handler.ts @@ -2,7 +2,7 @@ import { createBuiltinAgents } from "../agents"; import { createSisyphusJuniorAgentWithOverrides } from "../agents/sisyphus-junior"; import type { OhMyOpenCodeConfig } from "../config"; import { isTaskSystemEnabled, log, migrateAgentConfig } from "../shared"; -import { getAgentRuntimeName } from "../shared/agent-display-names"; +import { getAgentDisplayName, getAgentRuntimeName } from "../shared/agent-display-names"; import { AGENT_NAME_MAP } from "../shared/migration"; import { registerAgentName } from "../features/claude-code-session-state"; import { @@ -159,10 +159,10 @@ export async function applyAgentConfig(params: { if (isSisyphusEnabled && builtinAgents.sisyphus) { if (configuredDefaultAgent) { (params.config as { default_agent?: string }).default_agent = - getAgentRuntimeName(configuredDefaultAgent); + getAgentDisplayName(configuredDefaultAgent); } else { (params.config as { default_agent?: string }).default_agent = - getAgentRuntimeName("sisyphus"); + getAgentDisplayName("sisyphus"); } // Assembly order: Sisyphus -> Hephaestus -> Prometheus -> Atlas diff --git a/src/plugin-handlers/agent-key-remapper.ts b/src/plugin-handlers/agent-key-remapper.ts index 56aea9ae9..93499b014 100644 --- a/src/plugin-handlers/agent-key-remapper.ts +++ b/src/plugin-handlers/agent-key-remapper.ts @@ -1,4 +1,4 @@ -import { getAgentListDisplayName, getAgentRuntimeName } from "../shared/agent-display-names" +import { getAgentDisplayName, getAgentRuntimeName } from "../shared/agent-display-names" function rewriteAgentNameForListDisplay( key: string, @@ -21,7 +21,7 @@ export function remapAgentKeysToDisplayNames( const result: Record = {} for (const [key, value] of Object.entries(agents)) { - const displayName = getAgentListDisplayName(key) + const displayName = getAgentDisplayName(key) if (displayName && displayName !== key) { result[displayName] = rewriteAgentNameForListDisplay(key, value) // Regression guard: do not also assign result[key]. diff --git a/src/plugin-handlers/agent-priority-order.ts b/src/plugin-handlers/agent-priority-order.ts index 711f6a58c..003679e25 100644 --- a/src/plugin-handlers/agent-priority-order.ts +++ b/src/plugin-handlers/agent-priority-order.ts @@ -1,4 +1,4 @@ -import { getAgentListDisplayName } from "../shared/agent-display-names" +import { getAgentDisplayName } from "../shared/agent-display-names" /** * CRITICAL: This is the ONLY source of truth for core agent ordering. @@ -25,7 +25,7 @@ const CORE_AGENT_ORDER: ReadonlyArray<{ order: number }> = CANONICAL_CORE_AGENT_ORDER.map((configKey, index) => ({ configKey, - displayName: getAgentListDisplayName(configKey), + displayName: getAgentDisplayName(configKey), order: index + 1, })) diff --git a/src/plugin-handlers/command-config-handler.ts b/src/plugin-handlers/command-config-handler.ts index 471e4df52..86fdcfe26 100644 --- a/src/plugin-handlers/command-config-handler.ts +++ b/src/plugin-handlers/command-config-handler.ts @@ -1,7 +1,7 @@ import type { OhMyOpenCodeConfig } from "../config"; import { getAgentConfigKey, - getAgentListDisplayName, + getAgentDisplayName, } from "../shared/agent-display-names"; import { loadUserCommands, @@ -99,7 +99,7 @@ export async function applyCommandConfig(params: { function remapCommandAgentFields(commands: Record>): void { for (const cmd of Object.values(commands)) { if (cmd?.agent && typeof cmd.agent === "string") { - cmd.agent = getAgentListDisplayName(getAgentConfigKey(cmd.agent)); + cmd.agent = getAgentDisplayName(getAgentConfigKey(cmd.agent)); } } } diff --git a/src/plugin-handlers/tool-config-handler.ts b/src/plugin-handlers/tool-config-handler.ts index dae34fda6..d698e9560 100644 --- a/src/plugin-handlers/tool-config-handler.ts +++ b/src/plugin-handlers/tool-config-handler.ts @@ -1,5 +1,5 @@ import type { OhMyOpenCodeConfig } from "../config"; -import { getAgentDisplayName, getAgentListDisplayName } from "../shared/agent-display-names"; +import { getAgentDisplayName } from "../shared/agent-display-names"; import { isTaskSystemEnabled } from "../shared"; type AgentWithPermission = { permission?: Record }; @@ -16,7 +16,7 @@ function getConfigQuestionPermission(): string | null { } function agentByKey(agentResult: Record, key: string): AgentWithPermission | undefined { - return (agentResult[getAgentListDisplayName(key)] ?? agentResult[getAgentDisplayName(key)] ?? agentResult[key]) as + return (agentResult[getAgentDisplayName(key)] ?? agentResult[key]) as | AgentWithPermission | undefined; }