From 7fef07da2e73e8ec04486c7ea6ef110c01c86f87 Mon Sep 17 00:00:00 2001 From: YeonGyu-Kim Date: Sun, 14 Dec 2025 21:35:49 +0900 Subject: [PATCH] fix(config): normalize agent names to support case-insensitive config MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode) --- src/index.ts | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/index.ts b/src/index.ts index fd71051..12279f0 100644 --- a/src/index.ts +++ b/src/index.ts @@ -65,11 +65,36 @@ function getUserConfigDir(): string { return process.env.XDG_CONFIG_HOME || path.join(os.homedir(), ".config"); } +const AGENT_NAME_MAP: Record = { + omo: "OmO", + build: "build", + oracle: "oracle", + librarian: "librarian", + explore: "explore", + "frontend-ui-ux-engineer": "frontend-ui-ux-engineer", + "document-writer": "document-writer", + "multimodal-looker": "multimodal-looker", +}; + +function normalizeAgentNames(agents: Record): Record { + const normalized: Record = {}; + for (const [key, value] of Object.entries(agents)) { + const normalizedKey = AGENT_NAME_MAP[key.toLowerCase()] ?? key; + normalized[normalizedKey] = value; + } + return normalized; +} + function loadConfigFromPath(configPath: string): OhMyOpenCodeConfig | null { try { if (fs.existsSync(configPath)) { const content = fs.readFileSync(configPath, "utf-8"); const rawConfig = JSON.parse(content); + + if (rawConfig.agents && typeof rawConfig.agents === "object") { + rawConfig.agents = normalizeAgentNames(rawConfig.agents); + } + const result = OhMyOpenCodeConfigSchema.safeParse(rawConfig); if (!result.success) {