diff --git a/src/plugin-handlers/agent-config-handler.ts b/src/plugin-handlers/agent-config-handler.ts index 14993cda3..8a8d9ea1d 100644 --- a/src/plugin-handlers/agent-config-handler.ts +++ b/src/plugin-handlers/agent-config-handler.ts @@ -1,7 +1,7 @@ import { createBuiltinAgents } from "../agents"; import { createSisyphusJuniorAgentWithOverrides } from "../agents/sisyphus-junior"; import type { OhMyOpenCodeConfig } from "../config"; -import { log, migrateAgentConfig } from "../shared"; +import { isTaskSystemEnabled, log, migrateAgentConfig } from "../shared"; import { AGENT_NAME_MAP } from "../shared/migration"; import { getAgentDisplayName } from "../shared/agent-display-names"; import { registerAgentName } from "../features/claude-code-session-state"; @@ -90,7 +90,7 @@ export async function applyAgentConfig(params: { params.pluginConfig.browser_automation_engine?.provider ?? "playwright"; const currentModel = params.config.model as string | undefined; const disabledSkills = new Set(params.pluginConfig.disabled_skills ?? []); - const useTaskSystem = params.pluginConfig.experimental?.task_system ?? false; + const useTaskSystem = isTaskSystemEnabled(params.pluginConfig); const disableOmoEnv = params.pluginConfig.experimental?.disable_omo_env ?? false; const includeClaudeAgents = params.pluginConfig.claude_code?.agents ?? true; diff --git a/src/plugin-handlers/config-handler.test.ts b/src/plugin-handlers/config-handler.test.ts index 3c0af3a84..e4d681104 100644 --- a/src/plugin-handlers/config-handler.test.ts +++ b/src/plugin-handlers/config-handler.test.ts @@ -1281,6 +1281,10 @@ describe("per-agent todowrite/todoread deny when task_system enabled", () => { await handler(config) //#then + const lastCall = + createBuiltinAgentsMock.mock.calls[createBuiltinAgentsMock.mock.calls.length - 1] + expect(lastCall?.[11]).toBe(false) + const agentResult = config.agent as Record }> expect(agentResult[getAgentDisplayName("sisyphus")]?.permission?.todowrite).toBeUndefined() expect(agentResult[getAgentDisplayName("sisyphus")]?.permission?.todoread).toBeUndefined() @@ -1315,6 +1319,10 @@ describe("per-agent todowrite/todoread deny when task_system enabled", () => { await handler(config) //#then + const lastCall = + createBuiltinAgentsMock.mock.calls[createBuiltinAgentsMock.mock.calls.length - 1] + expect(lastCall?.[11]).toBe(false) + const agentResult = config.agent as Record }> expect(agentResult[getAgentDisplayName("sisyphus")]?.permission?.todowrite).toBeUndefined() expect(agentResult[getAgentDisplayName("sisyphus")]?.permission?.todoread).toBeUndefined()