From 9ef133a8c70662710b25c28509a851ce87241306 Mon Sep 17 00:00:00 2001 From: YeonGyu-Kim Date: Sun, 12 Apr 2026 02:28:15 +0900 Subject: [PATCH] fix(migration): register parenthesized legacy agent aliases in AGENT_NAME_MAP (#3281) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Old sessions and configs reference agent names in parenthesized format like 'Sisyphus (Ultraworker)' and 'Atlas (Plan Executor)' which failed to map during migration. Added entries for all six core agents. 🤖 Generated with OhMyOpenCode assistance https://github.com/code-yeongyu/oh-my-opencode --- src/shared/migration/agent-names.test.ts | 100 +++++++++++++++++++++++ src/shared/migration/agent-names.ts | 8 ++ 2 files changed, 108 insertions(+) create mode 100644 src/shared/migration/agent-names.test.ts diff --git a/src/shared/migration/agent-names.test.ts b/src/shared/migration/agent-names.test.ts new file mode 100644 index 000000000..c68d59499 --- /dev/null +++ b/src/shared/migration/agent-names.test.ts @@ -0,0 +1,100 @@ +/// + +import { describe, expect, test } from "bun:test" +import { AGENT_NAME_MAP, migrateAgentNames } from "./agent-names" + +describe("AGENT_NAME_MAP parenthesized aliases", () => { + test("maps Sisyphus (Ultraworker) to sisyphus", () => { + // given + const alias = "Sisyphus (Ultraworker)" + + // when + const result = AGENT_NAME_MAP[alias] + + // then + expect(result).toBe("sisyphus") + }) + + test("maps Hephaestus (Deep Agent) to hephaestus", () => { + // given + const alias = "Hephaestus (Deep Agent)" + + // when + const result = AGENT_NAME_MAP[alias] + + // then + expect(result).toBe("hephaestus") + }) + + test("maps Prometheus (Plan Builder) to prometheus", () => { + // given + const alias = "Prometheus (Plan Builder)" + + // when + const result = AGENT_NAME_MAP[alias] + + // then + expect(result).toBe("prometheus") + }) + + test("maps Atlas (Plan Executor) to atlas", () => { + // given + const alias = "Atlas (Plan Executor)" + + // when + const result = AGENT_NAME_MAP[alias] + + // then + expect(result).toBe("atlas") + }) + + test("maps Metis (Plan Consultant) to metis", () => { + // given + const alias = "Metis (Plan Consultant)" + + // when + const result = AGENT_NAME_MAP[alias] + + // then + expect(result).toBe("metis") + }) + + test("maps Momus (Plan Critic) to momus", () => { + // given + const alias = "Momus (Plan Critic)" + + // when + const result = AGENT_NAME_MAP[alias] + + // then + expect(result).toBe("momus") + }) +}) + +describe("migrateAgentNames with parenthesized aliases", () => { + test("migrates all parenthesized aliases to canonical names", () => { + // given + const legacyAgents = { + "Sisyphus (Ultraworker)": { model: "claude-opus-4" }, + "Hephaestus (Deep Agent)": { model: "gpt-5.4" }, + "Prometheus (Plan Builder)": { model: "claude-opus-4" }, + "Atlas (Plan Executor)": { model: "kimi-k2.5" }, + "Metis (Plan Consultant)": { model: "claude-opus-4" }, + "Momus (Plan Critic)": { model: "claude-opus-4" }, + } + + // when + const { migrated, changed } = migrateAgentNames(legacyAgents) + + // then + expect(changed).toBe(true) + expect(migrated.sisyphus).toEqual({ model: "claude-opus-4" }) + expect(migrated.hephaestus).toEqual({ model: "gpt-5.4" }) + expect(migrated.prometheus).toEqual({ model: "claude-opus-4" }) + expect(migrated.atlas).toEqual({ model: "kimi-k2.5" }) + expect(migrated.metis).toEqual({ model: "claude-opus-4" }) + expect(migrated.momus).toEqual({ model: "claude-opus-4" }) + expect(migrated["Sisyphus (Ultraworker)"]).toBeUndefined() + expect(migrated["Hephaestus (Deep Agent)"]).toBeUndefined() + }) +}) diff --git a/src/shared/migration/agent-names.ts b/src/shared/migration/agent-names.ts index 67b9e1dbe..d3c10fff0 100644 --- a/src/shared/migration/agent-names.ts +++ b/src/shared/migration/agent-names.ts @@ -3,28 +3,36 @@ export const AGENT_NAME_MAP: Record = { omo: "sisyphus", OmO: "sisyphus", Sisyphus: "sisyphus", + "Sisyphus (Ultraworker)": "sisyphus", sisyphus: "sisyphus", + // Hephaestus variants → "hephaestus" + "Hephaestus (Deep Agent)": "hephaestus", + // Prometheus variants → "prometheus" "OmO-Plan": "prometheus", "omo-plan": "prometheus", "Planner-Sisyphus": "prometheus", "planner-sisyphus": "prometheus", "Prometheus - Plan Builder": "prometheus", + "Prometheus (Plan Builder)": "prometheus", prometheus: "prometheus", // Atlas variants → "atlas" "orchestrator-sisyphus": "atlas", Atlas: "atlas", + "Atlas (Plan Executor)": "atlas", atlas: "atlas", // Metis variants → "metis" "plan-consultant": "metis", "Metis - Plan Consultant": "metis", + "Metis (Plan Consultant)": "metis", metis: "metis", // Momus variants → "momus" "Momus - Plan Critic": "momus", + "Momus (Plan Critic)": "momus", momus: "momus", // Sisyphus-Junior → "sisyphus-junior"