From 6c4e0b69a504bf8452ae264091a8b53b4be42fbe Mon Sep 17 00:00:00 2001 From: YeonGyu-Kim Date: Mon, 6 Apr 2026 17:16:11 +0900 Subject: [PATCH] fix(agents): enforce Sisyphus->Hephaestus->Prometheus->Atlas assembly order Extract hephaestus into agentConfig before prometheus so the config handler naturally assembles agents in the canonical order instead of relying solely on reorderAgentsByPriority to fix the wrong intermediate order. Also fix test data that had atlas/prometheus swapped and add missing hephaestus to agent-config-integration test lists. --- src/plugin-handlers/agent-config-handler.ts | 7 ++++++- src/plugin-handlers/config-handler.test.ts | 4 ++-- src/shared/agent-config-integration.test.ts | 7 ++++--- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/plugin-handlers/agent-config-handler.ts b/src/plugin-handlers/agent-config-handler.ts index 8a8d9ea1d..38e576692 100644 --- a/src/plugin-handlers/agent-config-handler.ts +++ b/src/plugin-handlers/agent-config-handler.ts @@ -163,10 +163,15 @@ export async function applyAgentConfig(params: { getAgentDisplayName("sisyphus"); } + // Assembly order: Sisyphus -> Hephaestus -> Prometheus -> Atlas const agentConfig: Record = { sisyphus: builtinAgents.sisyphus, }; + if (builtinAgents.hephaestus) { + agentConfig["hephaestus"] = builtinAgents.hephaestus; + } + agentConfig["sisyphus-junior"] = createSisyphusJuniorAgentWithOverrides( params.pluginConfig.agents?.["sisyphus-junior"], (builtinAgents.atlas as { model?: string } | undefined)?.model, @@ -248,7 +253,7 @@ export async function applyAgentConfig(params: { params.config.agent = { ...agentConfig, ...Object.fromEntries( - Object.entries(builtinAgents).filter(([key]) => key !== "sisyphus"), + Object.entries(builtinAgents).filter(([key]) => key !== "sisyphus" && key !== "hephaestus"), ), ...filterDisabledAgents(filteredUserAgents), ...filterDisabledAgents(filteredProjectAgents), diff --git a/src/plugin-handlers/config-handler.test.ts b/src/plugin-handlers/config-handler.test.ts index e4d681104..72681de0f 100644 --- a/src/plugin-handlers/config-handler.test.ts +++ b/src/plugin-handlers/config-handler.test.ts @@ -1205,8 +1205,8 @@ describe("per-agent todowrite/todoread deny when task_system enabled", () => { const AGENTS_WITH_TODO_DENY = new Set([ getAgentListDisplayName("sisyphus"), getAgentListDisplayName("hephaestus"), - getAgentListDisplayName("atlas"), getAgentListDisplayName("prometheus"), + getAgentListDisplayName("atlas"), getAgentListDisplayName("sisyphus-junior"), ]) @@ -1218,8 +1218,8 @@ describe("per-agent todowrite/todoread deny when task_system enabled", () => { createBuiltinAgentsMock.mockResolvedValue({ sisyphus: { name: "sisyphus", prompt: "test", mode: "primary" }, hephaestus: { name: "hephaestus", prompt: "test", mode: "primary" }, - atlas: { name: "atlas", prompt: "test", mode: "primary" }, prometheus: { name: "prometheus", prompt: "test", mode: "primary" }, + atlas: { name: "atlas", prompt: "test", mode: "primary" }, "sisyphus-junior": { name: "sisyphus-junior", prompt: "test", mode: "subagent" }, oracle: { name: "oracle", prompt: "test", mode: "subagent" }, }) diff --git a/src/shared/agent-config-integration.test.ts b/src/shared/agent-config-integration.test.ts index 1340dda7f..25cd14a26 100644 --- a/src/shared/agent-config-integration.test.ts +++ b/src/shared/agent-config-integration.test.ts @@ -86,15 +86,16 @@ describe("Agent Config Integration", () => { describe("Display name resolution", () => { test("returns correct display names for all builtin agents", () => { // given - lowercase config keys - const agents = ["sisyphus", "atlas", "prometheus", "metis", "momus", "oracle", "librarian", "explore", "multimodal-looker"] + const agents = ["sisyphus", "hephaestus", "prometheus", "atlas", "metis", "momus", "oracle", "librarian", "explore", "multimodal-looker"] // when - display names are requested const displayNames = agents.map((agent) => getAgentDisplayName(agent)) // then - display names are correct expect(displayNames).toContain("Sisyphus (Ultraworker)") - expect(displayNames).toContain("Atlas (Plan Executor)") + expect(displayNames).toContain("Hephaestus (Deep Agent)") expect(displayNames).toContain("Prometheus (Plan Builder)") + expect(displayNames).toContain("Atlas (Plan Executor)") expect(displayNames).toContain("Metis (Plan Consultant)") expect(displayNames).toContain("Momus (Plan Critic)") expect(displayNames).toContain("oracle") @@ -145,7 +146,7 @@ describe("Agent Config Integration", () => { test("model requirements include all builtin agents", () => { // given - expected builtin agents - const expectedAgents = ["sisyphus", "atlas", "prometheus", "metis", "momus", "oracle", "librarian", "explore", "multimodal-looker"] + const expectedAgents = ["sisyphus", "hephaestus", "prometheus", "atlas", "metis", "momus", "oracle", "librarian", "explore", "multimodal-looker"] // when - checking AGENT_MODEL_REQUIREMENTS const agentKeys = Object.keys(AGENT_MODEL_REQUIREMENTS)