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.
This commit is contained in:
YeonGyu-Kim
2026-04-06 17:16:11 +09:00
parent 56f2a9df3a
commit 6c4e0b69a5
3 changed files with 12 additions and 6 deletions
+6 -1
View File
@@ -163,10 +163,15 @@ export async function applyAgentConfig(params: {
getAgentDisplayName("sisyphus");
}
// Assembly order: Sisyphus -> Hephaestus -> Prometheus -> Atlas
const agentConfig: Record<string, unknown> = {
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),
+2 -2
View File
@@ -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" },
})
+4 -3
View File
@@ -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)