From 0399c1f4ed41953ab30d9af8fab3d468e7c2e8a0 Mon Sep 17 00:00:00 2001 From: YeonGyu-Kim Date: Thu, 25 Dec 2025 21:10:12 +0900 Subject: [PATCH] fix(sisyphus-agent): fix plan/build agent demotion logic in subagent mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously, the condition '&&plannerEnabled&&replacePlan' caused agents to be completely removed instead of demoted to subagent mode. The logic incorrectly prevented agents from being added back as subagents when Sisyphus is enabled with default config. Fixed by simplifying to just 'replacePlan' condition - agents are now properly demoted to subagent mode when replacement is enabled, which is the intended behavior per the README. 🤖 Generated with assistance of [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode) --- src/index.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/index.ts b/src/index.ts index 4e760c5..e98d8ab 100644 --- a/src/index.ts +++ b/src/index.ts @@ -422,12 +422,12 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => { : plannerSisyphusBase; } - // Filter out build/plan from config.agent if they will be replaced + // Filter out build/plan from config.agent - they'll be re-added as subagents if replaced const filteredConfigAgents = config.agent ? Object.fromEntries( Object.entries(config.agent).filter(([key]) => { - if (key === "build" && builderEnabled && replaceBuild) return false; - if (key === "plan" && plannerEnabled && replacePlan) return false; + if (key === "build" && replaceBuild) return false; + if (key === "plan" && replacePlan) return false; return true; }) ) : {}; @@ -438,9 +438,9 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => { ...userAgents, ...projectAgents, ...filteredConfigAgents, // Filtered config agents (excludes build/plan if replaced) - // Only set to subagent mode if NOT being replaced (for backward compatibility) - ...(replaceBuild && !builderEnabled ? { build: { ...config.agent?.build, mode: "subagent" } } : {}), - ...(replacePlan && !plannerEnabled ? { plan: { ...config.agent?.plan, mode: "subagent" } } : {}), + // Demote build/plan to subagent mode when replaced + ...(replaceBuild ? { build: { ...config.agent?.build, mode: "subagent" } } : {}), + ...(replacePlan ? { plan: { ...config.agent?.plan, mode: "subagent" } } : {}), }; } else { config.agent = {