diff --git a/src/agents/sisyphus-junior.test.ts b/src/agents/sisyphus-junior.test.ts index b6e00b281..c314c02d4 100644 --- a/src/agents/sisyphus-junior.test.ts +++ b/src/agents/sisyphus-junior.test.ts @@ -138,8 +138,8 @@ describe("createSisyphusJuniorAgentWithOverrides", () => { }) }) - describe("tool safety (blocked tools enforcement)", () => { - test("blocked tools remain blocked even if override tries to enable them via tools format", () => { + describe("tool safety (task/sisyphus_task blocked, call_omo_agent allowed)", () => { + test("task and sisyphus_task remain blocked, call_omo_agent is allowed via tools format", () => { // #given const override = { tools: { @@ -159,17 +159,19 @@ describe("createSisyphusJuniorAgentWithOverrides", () => { if (tools) { expect(tools.task).toBe(false) expect(tools.sisyphus_task).toBe(false) - expect(tools.call_omo_agent).toBe(false) + // call_omo_agent is NOW ALLOWED for subagents to spawn explore/librarian + expect(tools.call_omo_agent).toBe(true) expect(tools.read).toBe(true) } if (permission) { expect(permission.task).toBe("deny") expect(permission.sisyphus_task).toBe("deny") - expect(permission.call_omo_agent).toBe("deny") + // call_omo_agent is NOW ALLOWED for subagents to spawn explore/librarian + expect(permission.call_omo_agent).toBe("allow") } }) - test("blocked tools remain blocked when using permission format override", () => { + test("task and sisyphus_task remain blocked when using permission format override", () => { // #given const override = { permission: { @@ -183,18 +185,18 @@ describe("createSisyphusJuniorAgentWithOverrides", () => { // #when const result = createSisyphusJuniorAgentWithOverrides(override as Parameters[0]) - // #then - blocked tools should be denied regardless + // #then - task/sisyphus_task blocked, but call_omo_agent allowed for explore/librarian spawning const tools = result.tools as Record | undefined const permission = result.permission as Record | undefined if (tools) { expect(tools.task).toBe(false) expect(tools.sisyphus_task).toBe(false) - expect(tools.call_omo_agent).toBe(false) + expect(tools.call_omo_agent).toBe(true) } if (permission) { expect(permission.task).toBe("deny") expect(permission.sisyphus_task).toBe("deny") - expect(permission.call_omo_agent).toBe("deny") + expect(permission.call_omo_agent).toBe("allow") } }) }) diff --git a/src/agents/sisyphus-junior.ts b/src/agents/sisyphus-junior.ts index 649268c0e..671983a10 100644 --- a/src/agents/sisyphus-junior.ts +++ b/src/agents/sisyphus-junior.ts @@ -15,11 +15,10 @@ Execute tasks directly. NEVER delegate or spawn other agents. BLOCKED ACTIONS (will fail if attempted): - task tool: BLOCKED -- sisyphus_task tool: BLOCKED -- sisyphus_task tool: BLOCKED (already blocked above, but explicit) -- call_omo_agent tool: BLOCKED +- sisyphus_task tool: BLOCKED -You work ALONE. No delegation. No background tasks. Execute directly. +ALLOWED: call_omo_agent - You CAN spawn explore/librarian agents for research. +You work ALONE for implementation. No delegation of implementation tasks. @@ -76,7 +75,8 @@ function buildSisyphusJuniorPrompt(promptAppend?: string): string { } // Core tools that Sisyphus-Junior must NEVER have access to -const BLOCKED_TOOLS = ["task", "sisyphus_task", "call_omo_agent"] +// Note: call_omo_agent is ALLOWED so subagents can spawn explore/librarian +const BLOCKED_TOOLS = ["task", "sisyphus_task"] export const SISYPHUS_JUNIOR_DEFAULTS = { model: "anthropic/claude-sonnet-4-5", @@ -106,6 +106,7 @@ export function createSisyphusJuniorAgentWithOverrides( for (const tool of BLOCKED_TOOLS) { merged[tool] = "deny" } + merged.call_omo_agent = "allow" toolsConfig = { permission: { ...merged, ...basePermission } } } else { const userTools = override?.tools ?? {} @@ -114,6 +115,7 @@ export function createSisyphusJuniorAgentWithOverrides( for (const tool of BLOCKED_TOOLS) { merged[tool] = false } + merged.call_omo_agent = true toolsConfig = { tools: { ...merged, ...baseTools } } } diff --git a/src/plugin-handlers/config-handler.ts b/src/plugin-handlers/config-handler.ts index a25900f0a..d87540510 100644 --- a/src/plugin-handlers/config-handler.ts +++ b/src/plugin-handlers/config-handler.ts @@ -283,19 +283,11 @@ export function createConfigHandler(deps: ConfigHandlerDeps) { config.tools = { ...(config.tools as Record), "grep_app_*": false, - call_omo_agent: false, }; - if (agentResult.explore) { - agentResult.explore.tools = { - ...agentResult.explore.tools, - call_omo_agent: false, - }; - } if (agentResult.librarian) { agentResult.librarian.tools = { ...agentResult.librarian.tools, - call_omo_agent: false, "grep_app_*": true, }; } @@ -303,7 +295,6 @@ export function createConfigHandler(deps: ConfigHandlerDeps) { agentResult["multimodal-looker"].tools = { ...agentResult["multimodal-looker"].tools, task: false, - call_omo_agent: false, look_at: false, }; } diff --git a/src/tools/call-omo-agent/tools.ts b/src/tools/call-omo-agent/tools.ts index 1c6e21b91..5d2e4b8f0 100644 --- a/src/tools/call-omo-agent/tools.ts +++ b/src/tools/call-omo-agent/tools.ts @@ -176,7 +176,6 @@ async function executeSync( agent: args.subagent_type, tools: { task: false, - call_omo_agent: false, sisyphus_task: false, }, parts: [{ type: "text", text: args.prompt }],