From c70ca396615f9e74ddf6b2301356c69c3c65ca53 Mon Sep 17 00:00:00 2001 From: justsisyphus Date: Thu, 22 Jan 2026 10:39:27 +0900 Subject: [PATCH] fix: prevent OpenCode defaults from overwriting user agent config in oh-my-opencode.json Fixes #472 When user sets agents.explore.model in oh-my-opencode.json, the config was being ignored because OpenCode's built-in explore agent overwrote it. Filter out agents that oh-my-opencode provides from OpenCode's config to ensure user config takes precedence. --- src/plugin-handlers/config-handler.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/plugin-handlers/config-handler.ts b/src/plugin-handlers/config-handler.ts index 3ba18add..704036d5 100644 --- a/src/plugin-handlers/config-handler.ts +++ b/src/plugin-handlers/config-handler.ts @@ -260,6 +260,10 @@ export function createConfigHandler(deps: ConfigHandlerDeps) { .filter(([key]) => { if (key === "build") return false; if (key === "plan" && replacePlan) return false; + // Filter out agents that oh-my-opencode provides to prevent + // OpenCode defaults from overwriting user config in oh-my-opencode.json + // See: https://github.com/code-yeongyu/oh-my-opencode/issues/472 + if (key in builtinAgents) return false; return true; }) .map(([key, value]) => [