Merge branch 'fix/p0-5-task-system-default' into dev

This commit is contained in:
YeonGyu-Kim
2026-04-01 18:23:18 -07:00
4 changed files with 71 additions and 60 deletions
+1 -1
View File
@@ -90,7 +90,7 @@ export async function applyAgentConfig(params: {
params.pluginConfig.browser_automation_engine?.provider ?? "playwright"; params.pluginConfig.browser_automation_engine?.provider ?? "playwright";
const currentModel = params.config.model as string | undefined; const currentModel = params.config.model as string | undefined;
const disabledSkills = new Set<string>(params.pluginConfig.disabled_skills ?? []); const disabledSkills = new Set<string>(params.pluginConfig.disabled_skills ?? []);
const useTaskSystem = params.pluginConfig.experimental?.task_system ?? true; const useTaskSystem = params.pluginConfig.experimental?.task_system ?? false;
const disableOmoEnv = params.pluginConfig.experimental?.disable_omo_env ?? false; const disableOmoEnv = params.pluginConfig.experimental?.disable_omo_env ?? false;
const includeClaudeAgents = params.pluginConfig.claude_code?.agents ?? true; const includeClaudeAgents = params.pluginConfig.claude_code?.agents ?? true;
+66 -55
View File
@@ -20,6 +20,17 @@ import * as configDir from "../shared/opencode-config-dir"
import * as permissionCompat from "../shared/permission-compat" import * as permissionCompat from "../shared/permission-compat"
import * as modelResolver from "../shared/model-resolver" import * as modelResolver from "../shared/model-resolver"
function createPluginConfig(overrides: Partial<OhMyOpenCodeConfig> = {}): OhMyOpenCodeConfig {
return {
git_master: {
commit_footer: true,
include_co_authored_by: true,
git_env_prefix: "GIT_MASTER=1",
},
...overrides,
}
}
beforeEach(() => { beforeEach(() => {
spyOn(agents, "createBuiltinAgents" as any).mockResolvedValue({ spyOn(agents, "createBuiltinAgents" as any).mockResolvedValue({
sisyphus: { name: "sisyphus", prompt: "test", mode: "primary" }, sisyphus: { name: "sisyphus", prompt: "test", mode: "primary" },
@@ -105,7 +116,7 @@ afterEach(() => {
describe("Sisyphus-Junior model inheritance", () => { describe("Sisyphus-Junior model inheritance", () => {
test("does not inherit UI-selected model as system default", async () => { test("does not inherit UI-selected model as system default", async () => {
// #given // #given
const pluginConfig: OhMyOpenCodeConfig = {} const pluginConfig = createPluginConfig({})
const config: Record<string, unknown> = { const config: Record<string, unknown> = {
model: "opencode/kimi-k2.5-free", model: "opencode/kimi-k2.5-free",
agent: {}, agent: {},
@@ -131,13 +142,13 @@ describe("Sisyphus-Junior model inheritance", () => {
test("uses explicitly configured sisyphus-junior model", async () => { test("uses explicitly configured sisyphus-junior model", async () => {
// #given // #given
const pluginConfig: OhMyOpenCodeConfig = { const pluginConfig = createPluginConfig({
agents: { agents: {
"sisyphus-junior": { "sisyphus-junior": {
model: "openai/gpt-5.3-codex", model: "openai/gpt-5.3-codex",
}, },
}, },
} })
const config: Record<string, unknown> = { const config: Record<string, unknown> = {
model: "opencode/kimi-k2.5-free", model: "opencode/kimi-k2.5-free",
agent: {}, agent: {},
@@ -174,11 +185,11 @@ describe("Plan agent demote behavior", () => {
oracle: { name: "oracle", prompt: "test", mode: "subagent" }, oracle: { name: "oracle", prompt: "test", mode: "subagent" },
atlas: { name: "atlas", prompt: "test", mode: "primary" }, atlas: { name: "atlas", prompt: "test", mode: "primary" },
}) })
const pluginConfig: OhMyOpenCodeConfig = { const pluginConfig = createPluginConfig({
sisyphus_agent: { sisyphus_agent: {
planner_enabled: true, planner_enabled: true,
}, },
} })
const config: Record<string, unknown> = { const config: Record<string, unknown> = {
model: "anthropic/claude-opus-4-6", model: "anthropic/claude-opus-4-6",
agent: {}, agent: {},
@@ -209,12 +220,12 @@ describe("Plan agent demote behavior", () => {
test("plan agent should be demoted to subagent without inheriting prometheus prompt", async () => { test("plan agent should be demoted to subagent without inheriting prometheus prompt", async () => {
// #given // #given
const pluginConfig: OhMyOpenCodeConfig = { const pluginConfig = createPluginConfig({
sisyphus_agent: { sisyphus_agent: {
planner_enabled: true, planner_enabled: true,
replace_plan: true, replace_plan: true,
}, },
} })
const config: Record<string, unknown> = { const config: Record<string, unknown> = {
model: "anthropic/claude-opus-4-6", model: "anthropic/claude-opus-4-6",
agent: { agent: {
@@ -247,11 +258,11 @@ describe("Plan agent demote behavior", () => {
test("plan agent remains unchanged when planner is disabled", async () => { test("plan agent remains unchanged when planner is disabled", async () => {
// #given // #given
const pluginConfig: OhMyOpenCodeConfig = { const pluginConfig = createPluginConfig({
sisyphus_agent: { sisyphus_agent: {
planner_enabled: false, planner_enabled: false,
}, },
} })
const config: Record<string, unknown> = { const config: Record<string, unknown> = {
model: "anthropic/claude-opus-4-6", model: "anthropic/claude-opus-4-6",
agent: { agent: {
@@ -284,11 +295,11 @@ describe("Plan agent demote behavior", () => {
test("prometheus should have mode 'all' to be callable via task", async () => { test("prometheus should have mode 'all' to be callable via task", async () => {
// given // given
const pluginConfig: OhMyOpenCodeConfig = { const pluginConfig = createPluginConfig({
sisyphus_agent: { sisyphus_agent: {
planner_enabled: true, planner_enabled: true,
}, },
} })
const config: Record<string, unknown> = { const config: Record<string, unknown> = {
model: "anthropic/claude-opus-4-6", model: "anthropic/claude-opus-4-6",
agent: {}, agent: {},
@@ -324,7 +335,7 @@ describe("Agent permission defaults", () => {
hephaestus: { name: "hephaestus", prompt: "test", mode: "primary" }, hephaestus: { name: "hephaestus", prompt: "test", mode: "primary" },
oracle: { name: "oracle", prompt: "test", mode: "subagent" }, oracle: { name: "oracle", prompt: "test", mode: "subagent" },
}) })
const pluginConfig: OhMyOpenCodeConfig = {} const pluginConfig = createPluginConfig({})
const config: Record<string, unknown> = { const config: Record<string, unknown> = {
model: "anthropic/claude-opus-4-6", model: "anthropic/claude-opus-4-6",
agent: {}, agent: {},
@@ -352,7 +363,7 @@ describe("Agent permission defaults", () => {
describe("default_agent behavior with Sisyphus orchestration", () => { describe("default_agent behavior with Sisyphus orchestration", () => {
test("canonicalizes configured default_agent with surrounding whitespace", async () => { test("canonicalizes configured default_agent with surrounding whitespace", async () => {
// given // given
const pluginConfig: OhMyOpenCodeConfig = {} const pluginConfig = createPluginConfig({})
const config: Record<string, unknown> = { const config: Record<string, unknown> = {
model: "anthropic/claude-opus-4-6", model: "anthropic/claude-opus-4-6",
default_agent: " hephaestus ", default_agent: " hephaestus ",
@@ -376,7 +387,7 @@ describe("default_agent behavior with Sisyphus orchestration", () => {
test("canonicalizes configured default_agent when key uses mixed case", async () => { test("canonicalizes configured default_agent when key uses mixed case", async () => {
// given // given
const pluginConfig: OhMyOpenCodeConfig = {} const pluginConfig = createPluginConfig({})
const config: Record<string, unknown> = { const config: Record<string, unknown> = {
model: "anthropic/claude-opus-4-6", model: "anthropic/claude-opus-4-6",
default_agent: "HePhAeStUs", default_agent: "HePhAeStUs",
@@ -400,7 +411,7 @@ describe("default_agent behavior with Sisyphus orchestration", () => {
test("canonicalizes configured default_agent key to display name", async () => { test("canonicalizes configured default_agent key to display name", async () => {
// #given // #given
const pluginConfig: OhMyOpenCodeConfig = {} const pluginConfig = createPluginConfig({})
const config: Record<string, unknown> = { const config: Record<string, unknown> = {
model: "anthropic/claude-opus-4-6", model: "anthropic/claude-opus-4-6",
default_agent: "hephaestus", default_agent: "hephaestus",
@@ -424,7 +435,7 @@ describe("default_agent behavior with Sisyphus orchestration", () => {
test("preserves existing display-name default_agent", async () => { test("preserves existing display-name default_agent", async () => {
// #given // #given
const pluginConfig: OhMyOpenCodeConfig = {} const pluginConfig = createPluginConfig({})
const displayName = getAgentDisplayName("hephaestus") const displayName = getAgentDisplayName("hephaestus")
const config: Record<string, unknown> = { const config: Record<string, unknown> = {
model: "anthropic/claude-opus-4-6", model: "anthropic/claude-opus-4-6",
@@ -449,7 +460,7 @@ describe("default_agent behavior with Sisyphus orchestration", () => {
test("sets default_agent to sisyphus when missing", async () => { test("sets default_agent to sisyphus when missing", async () => {
// #given // #given
const pluginConfig: OhMyOpenCodeConfig = {} const pluginConfig = createPluginConfig({})
const config: Record<string, unknown> = { const config: Record<string, unknown> = {
model: "anthropic/claude-opus-4-6", model: "anthropic/claude-opus-4-6",
agent: {}, agent: {},
@@ -472,7 +483,7 @@ describe("default_agent behavior with Sisyphus orchestration", () => {
test("sets default_agent to sisyphus when configured default_agent is empty after trim", async () => { test("sets default_agent to sisyphus when configured default_agent is empty after trim", async () => {
// given // given
const pluginConfig: OhMyOpenCodeConfig = {} const pluginConfig = createPluginConfig({})
const config: Record<string, unknown> = { const config: Record<string, unknown> = {
model: "anthropic/claude-opus-4-6", model: "anthropic/claude-opus-4-6",
default_agent: " ", default_agent: " ",
@@ -496,7 +507,7 @@ describe("default_agent behavior with Sisyphus orchestration", () => {
test("preserves custom default_agent names while trimming whitespace", async () => { test("preserves custom default_agent names while trimming whitespace", async () => {
// given // given
const pluginConfig: OhMyOpenCodeConfig = {} const pluginConfig = createPluginConfig({})
const config: Record<string, unknown> = { const config: Record<string, unknown> = {
model: "anthropic/claude-opus-4-6", model: "anthropic/claude-opus-4-6",
default_agent: " Custom Agent ", default_agent: " Custom Agent ",
@@ -520,11 +531,11 @@ describe("default_agent behavior with Sisyphus orchestration", () => {
test("does not normalize configured default_agent when Sisyphus is disabled", async () => { test("does not normalize configured default_agent when Sisyphus is disabled", async () => {
// given // given
const pluginConfig: OhMyOpenCodeConfig = { const pluginConfig = createPluginConfig({
sisyphus_agent: { sisyphus_agent: {
disabled: true, disabled: true,
}, },
} })
const config: Record<string, unknown> = { const config: Record<string, unknown> = {
model: "anthropic/claude-opus-4-6", model: "anthropic/claude-opus-4-6",
default_agent: " HePhAeStUs ", default_agent: " HePhAeStUs ",
@@ -650,7 +661,7 @@ describe("Prometheus category config resolution", () => {
describe("Prometheus direct override priority over category", () => { describe("Prometheus direct override priority over category", () => {
test("direct reasoningEffort takes priority over category reasoningEffort", async () => { test("direct reasoningEffort takes priority over category reasoningEffort", async () => {
// given - category has reasoningEffort=xhigh, direct override says "low" // given - category has reasoningEffort=xhigh, direct override says "low"
const pluginConfig: OhMyOpenCodeConfig = { const pluginConfig = createPluginConfig({
sisyphus_agent: { sisyphus_agent: {
planner_enabled: true, planner_enabled: true,
}, },
@@ -666,7 +677,7 @@ describe("Prometheus direct override priority over category", () => {
reasoningEffort: "low", reasoningEffort: "low",
}, },
}, },
} })
const config: Record<string, unknown> = { const config: Record<string, unknown> = {
model: "anthropic/claude-opus-4-6", model: "anthropic/claude-opus-4-6",
agent: {}, agent: {},
@@ -692,7 +703,7 @@ describe("Prometheus direct override priority over category", () => {
test("category reasoningEffort applied when no direct override", async () => { test("category reasoningEffort applied when no direct override", async () => {
// given - category has reasoningEffort but no direct override // given - category has reasoningEffort but no direct override
const pluginConfig: OhMyOpenCodeConfig = { const pluginConfig = createPluginConfig({
sisyphus_agent: { sisyphus_agent: {
planner_enabled: true, planner_enabled: true,
}, },
@@ -707,7 +718,7 @@ describe("Prometheus direct override priority over category", () => {
category: "reasoning-cat", category: "reasoning-cat",
}, },
}, },
} })
const config: Record<string, unknown> = { const config: Record<string, unknown> = {
model: "anthropic/claude-opus-4-6", model: "anthropic/claude-opus-4-6",
agent: {}, agent: {},
@@ -733,7 +744,7 @@ describe("Prometheus direct override priority over category", () => {
test("direct temperature takes priority over category temperature", async () => { test("direct temperature takes priority over category temperature", async () => {
// given // given
const pluginConfig: OhMyOpenCodeConfig = { const pluginConfig = createPluginConfig({
sisyphus_agent: { sisyphus_agent: {
planner_enabled: true, planner_enabled: true,
}, },
@@ -749,7 +760,7 @@ describe("Prometheus direct override priority over category", () => {
temperature: 0.1, temperature: 0.1,
}, },
}, },
} })
const config: Record<string, unknown> = { const config: Record<string, unknown> = {
model: "anthropic/claude-opus-4-6", model: "anthropic/claude-opus-4-6",
agent: {}, agent: {},
@@ -776,7 +787,7 @@ describe("Prometheus direct override priority over category", () => {
test("prometheus prompt_append is appended to base prompt", async () => { test("prometheus prompt_append is appended to base prompt", async () => {
// #given - prometheus override with prompt_append // #given - prometheus override with prompt_append
const customInstructions = "## Custom Project Rules\nUse max 2 commits." const customInstructions = "## Custom Project Rules\nUse max 2 commits."
const pluginConfig: OhMyOpenCodeConfig = { const pluginConfig = createPluginConfig({
sisyphus_agent: { sisyphus_agent: {
planner_enabled: true, planner_enabled: true,
}, },
@@ -785,7 +796,7 @@ describe("Prometheus direct override priority over category", () => {
prompt_append: customInstructions, prompt_append: customInstructions,
}, },
}, },
} })
const config: Record<string, unknown> = { const config: Record<string, unknown> = {
model: "anthropic/claude-opus-4-6", model: "anthropic/claude-opus-4-6",
agent: {}, agent: {},
@@ -820,12 +831,12 @@ describe("Plan agent model inheritance from prometheus", () => {
provenance: "provider-fallback", provenance: "provider-fallback",
variant: "max", variant: "max",
}) })
const pluginConfig: OhMyOpenCodeConfig = { const pluginConfig = createPluginConfig({
sisyphus_agent: { sisyphus_agent: {
planner_enabled: true, planner_enabled: true,
replace_plan: true, replace_plan: true,
}, },
} })
const config: Record<string, unknown> = { const config: Record<string, unknown> = {
model: "anthropic/claude-opus-4-6", model: "anthropic/claude-opus-4-6",
agent: { agent: {
@@ -864,7 +875,7 @@ describe("Plan agent model inheritance from prometheus", () => {
provenance: "override", provenance: "override",
variant: "high", variant: "high",
}) })
const pluginConfig: OhMyOpenCodeConfig = { const pluginConfig = createPluginConfig({
sisyphus_agent: { sisyphus_agent: {
planner_enabled: true, planner_enabled: true,
replace_plan: true, replace_plan: true,
@@ -881,7 +892,7 @@ describe("Plan agent model inheritance from prometheus", () => {
thinking: { type: "enabled", budgetTokens: 8000 }, thinking: { type: "enabled", budgetTokens: 8000 },
}, },
}, },
} })
const config: Record<string, unknown> = { const config: Record<string, unknown> = {
model: "anthropic/claude-opus-4-6", model: "anthropic/claude-opus-4-6",
agent: {}, agent: {},
@@ -919,7 +930,7 @@ describe("Plan agent model inheritance from prometheus", () => {
provenance: "provider-fallback", provenance: "provider-fallback",
variant: "max", variant: "max",
}) })
const pluginConfig: OhMyOpenCodeConfig = { const pluginConfig = createPluginConfig({
sisyphus_agent: { sisyphus_agent: {
planner_enabled: true, planner_enabled: true,
replace_plan: true, replace_plan: true,
@@ -931,7 +942,7 @@ describe("Plan agent model inheritance from prometheus", () => {
temperature: 0.5, temperature: 0.5,
}, },
}, },
} })
const config: Record<string, unknown> = { const config: Record<string, unknown> = {
model: "anthropic/claude-opus-4-6", model: "anthropic/claude-opus-4-6",
agent: {}, agent: {},
@@ -962,12 +973,12 @@ describe("Plan agent model inheritance from prometheus", () => {
provenance: "provider-fallback", provenance: "provider-fallback",
variant: "max", variant: "max",
}) })
const pluginConfig: OhMyOpenCodeConfig = { const pluginConfig = createPluginConfig({
sisyphus_agent: { sisyphus_agent: {
planner_enabled: true, planner_enabled: true,
replace_plan: true, replace_plan: true,
}, },
} })
const config: Record<string, unknown> = { const config: Record<string, unknown> = {
model: "anthropic/claude-opus-4-6", model: "anthropic/claude-opus-4-6",
agent: {}, agent: {},
@@ -1001,11 +1012,11 @@ describe("Deadlock prevention - fetchAvailableModels must not receive client", (
// - Server waits for plugin init to complete before handling requests // - Server waits for plugin init to complete before handling requests
const fetchSpy = spyOn(shared, "fetchAvailableModels" as any).mockResolvedValue(new Set<string>()) const fetchSpy = spyOn(shared, "fetchAvailableModels" as any).mockResolvedValue(new Set<string>())
const pluginConfig: OhMyOpenCodeConfig = { const pluginConfig = createPluginConfig({
sisyphus_agent: { sisyphus_agent: {
planner_enabled: true, planner_enabled: true,
}, },
} })
const config: Record<string, unknown> = { const config: Record<string, unknown> = {
model: "anthropic/claude-opus-4-6", model: "anthropic/claude-opus-4-6",
agent: {}, agent: {},
@@ -1041,7 +1052,7 @@ describe("config-handler plugin loading error boundary (#1559)", () => {
//#given //#given
;(pluginLoader.loadAllPluginComponents as any).mockRestore?.() ;(pluginLoader.loadAllPluginComponents as any).mockRestore?.()
spyOn(pluginLoader, "loadAllPluginComponents" as any).mockRejectedValue(new Error("crash")) spyOn(pluginLoader, "loadAllPluginComponents" as any).mockRejectedValue(new Error("crash"))
const pluginConfig: OhMyOpenCodeConfig = {} const pluginConfig = createPluginConfig({})
const config: Record<string, unknown> = { const config: Record<string, unknown> = {
model: "anthropic/claude-opus-4-6", model: "anthropic/claude-opus-4-6",
agent: {}, agent: {},
@@ -1068,9 +1079,9 @@ describe("config-handler plugin loading error boundary (#1559)", () => {
spyOn(pluginLoader, "loadAllPluginComponents" as any).mockImplementation( spyOn(pluginLoader, "loadAllPluginComponents" as any).mockImplementation(
() => new Promise(() => {}) () => new Promise(() => {})
) )
const pluginConfig: OhMyOpenCodeConfig = { const pluginConfig = createPluginConfig({
experimental: { plugin_load_timeout_ms: 100 }, experimental: { plugin_load_timeout_ms: 100 },
} })
const config: Record<string, unknown> = { const config: Record<string, unknown> = {
model: "anthropic/claude-opus-4-6", model: "anthropic/claude-opus-4-6",
agent: {}, agent: {},
@@ -1096,7 +1107,7 @@ describe("config-handler plugin loading error boundary (#1559)", () => {
;(pluginLoader.loadAllPluginComponents as any).mockRestore?.() ;(pluginLoader.loadAllPluginComponents as any).mockRestore?.()
spyOn(pluginLoader, "loadAllPluginComponents" as any).mockRejectedValue(new Error("crash")) spyOn(pluginLoader, "loadAllPluginComponents" as any).mockRejectedValue(new Error("crash"))
const logSpy = shared.log as ReturnType<typeof spyOn> const logSpy = shared.log as ReturnType<typeof spyOn>
const pluginConfig: OhMyOpenCodeConfig = {} const pluginConfig = createPluginConfig({})
const config: Record<string, unknown> = { const config: Record<string, unknown> = {
model: "anthropic/claude-opus-4-6", model: "anthropic/claude-opus-4-6",
agent: {}, agent: {},
@@ -1133,7 +1144,7 @@ describe("config-handler plugin loading error boundary (#1559)", () => {
plugins: [{ name: "test-plugin", version: "1.0.0" }], plugins: [{ name: "test-plugin", version: "1.0.0" }],
errors: [], errors: [],
}) })
const pluginConfig: OhMyOpenCodeConfig = {} const pluginConfig = createPluginConfig({})
const config: Record<string, unknown> = { const config: Record<string, unknown> = {
model: "anthropic/claude-opus-4-6", model: "anthropic/claude-opus-4-6",
agent: {}, agent: {},
@@ -1179,9 +1190,9 @@ describe("per-agent todowrite/todoread deny when task_system enabled", () => {
oracle: { name: "oracle", prompt: "test", mode: "subagent" }, oracle: { name: "oracle", prompt: "test", mode: "subagent" },
}) })
const pluginConfig: OhMyOpenCodeConfig = { const pluginConfig = createPluginConfig({
experimental: { task_system: true }, experimental: { task_system: true },
} })
const config: Record<string, unknown> = { const config: Record<string, unknown> = {
model: "anthropic/claude-opus-4-6", model: "anthropic/claude-opus-4-6",
agent: {}, agent: {},
@@ -1216,9 +1227,9 @@ describe("per-agent todowrite/todoread deny when task_system enabled", () => {
hephaestus: { name: "hephaestus", prompt: "test", mode: "primary" }, hephaestus: { name: "hephaestus", prompt: "test", mode: "primary" },
}) })
const pluginConfig: OhMyOpenCodeConfig = { const pluginConfig = createPluginConfig({
experimental: { task_system: false }, experimental: { task_system: false },
} })
const config: Record<string, unknown> = { const config: Record<string, unknown> = {
model: "anthropic/claude-opus-4-6", model: "anthropic/claude-opus-4-6",
agent: {}, agent: {},
@@ -1243,7 +1254,7 @@ describe("per-agent todowrite/todoread deny when task_system enabled", () => {
expect(agentResult[getAgentDisplayName("hephaestus")]?.permission?.todoread).toBeUndefined() expect(agentResult[getAgentDisplayName("hephaestus")]?.permission?.todoread).toBeUndefined()
}) })
test("denies todowrite/todoread when task_system is undefined", async () => { test("does not deny todowrite/todoread when task_system is undefined", async () => {
//#given //#given
const createBuiltinAgentsMock = agents.createBuiltinAgents as unknown as { const createBuiltinAgentsMock = agents.createBuiltinAgents as unknown as {
mockResolvedValue: (value: Record<string, unknown>) => void mockResolvedValue: (value: Record<string, unknown>) => void
@@ -1252,7 +1263,7 @@ describe("per-agent todowrite/todoread deny when task_system enabled", () => {
sisyphus: { name: "sisyphus", prompt: "test", mode: "primary" }, sisyphus: { name: "sisyphus", prompt: "test", mode: "primary" },
}) })
const pluginConfig: OhMyOpenCodeConfig = {} const pluginConfig = createPluginConfig({})
const config: Record<string, unknown> = { const config: Record<string, unknown> = {
model: "anthropic/claude-opus-4-6", model: "anthropic/claude-opus-4-6",
agent: {}, agent: {},
@@ -1271,8 +1282,8 @@ describe("per-agent todowrite/todoread deny when task_system enabled", () => {
//#then //#then
const agentResult = config.agent as Record<string, { permission?: Record<string, unknown> }> const agentResult = config.agent as Record<string, { permission?: Record<string, unknown> }>
expect(agentResult[getAgentDisplayName("sisyphus")]?.permission?.todowrite).toBe("deny") expect(agentResult[getAgentDisplayName("sisyphus")]?.permission?.todowrite).toBeUndefined()
expect(agentResult[getAgentDisplayName("sisyphus")]?.permission?.todoread).toBe("deny") expect(agentResult[getAgentDisplayName("sisyphus")]?.permission?.todoread).toBeUndefined()
}) })
}) })
@@ -1287,9 +1298,9 @@ describe("disable_omo_env pass-through", () => {
sisyphus: { name: "sisyphus", prompt: "without-env", mode: "primary" }, sisyphus: { name: "sisyphus", prompt: "without-env", mode: "primary" },
}) })
const pluginConfig: OhMyOpenCodeConfig = { const pluginConfig = createPluginConfig({
experimental: { disable_omo_env: true }, experimental: { disable_omo_env: true },
} })
const config: Record<string, unknown> = { const config: Record<string, unknown> = {
model: "anthropic/claude-opus-4-6", model: "anthropic/claude-opus-4-6",
agent: {}, agent: {},
@@ -1323,7 +1334,7 @@ describe("disable_omo_env pass-through", () => {
sisyphus: { name: "sisyphus", prompt: "with-env", mode: "primary" }, sisyphus: { name: "sisyphus", prompt: "with-env", mode: "primary" },
}) })
const pluginConfig: OhMyOpenCodeConfig = {} const pluginConfig = createPluginConfig({})
const config: Record<string, unknown> = { const config: Record<string, unknown> = {
model: "anthropic/claude-opus-4-6", model: "anthropic/claude-opus-4-6",
agent: {}, agent: {},
@@ -224,7 +224,7 @@ describe("applyToolConfig", () => {
"hephaestus", "hephaestus",
"prometheus", "prometheus",
"sisyphus-junior", "sisyphus-junior",
])("#then should deny todo tools for %s agent by default", (agentName) => { ])("#then should NOT deny todo tools for %s agent by default", (agentName) => {
const params = createParams({ const params = createParams({
agents: [agentName], agents: [agentName],
}) })
@@ -234,8 +234,8 @@ describe("applyToolConfig", () => {
const agent = params.agentResult[agentName] as { const agent = params.agentResult[agentName] as {
permission: Record<string, unknown> permission: Record<string, unknown>
} }
expect(agent.permission.todowrite).toBe("deny") expect(agent.permission.todowrite).toBeUndefined()
expect(agent.permission.todoread).toBe("deny") expect(agent.permission.todoread).toBeUndefined()
}) })
}) })
}) })
+1 -1
View File
@@ -25,7 +25,7 @@ export function applyToolConfig(params: {
pluginConfig: OhMyOpenCodeConfig; pluginConfig: OhMyOpenCodeConfig;
agentResult: Record<string, unknown>; agentResult: Record<string, unknown>;
}): void { }): void {
const taskSystemEnabled = params.pluginConfig.experimental?.task_system ?? true const taskSystemEnabled = params.pluginConfig.experimental?.task_system ?? false
const denyTodoTools = taskSystemEnabled const denyTodoTools = taskSystemEnabled
? { todowrite: "deny", todoread: "deny" } ? { todowrite: "deny", todoread: "deny" }
: {} : {}