From 8916a32ea092657d208b2b9d02419ecd701a798d Mon Sep 17 00:00:00 2001 From: YeonGyu-Kim Date: Tue, 13 Jan 2026 21:00:00 +0900 Subject: [PATCH] fix(agents): use createAgentToolRestrictions for Sisyphus call_omo_agent deny Use version-aware permission system instead of hardcoded tools object. This ensures call_omo_agent is properly denied on both old (tools) and new (permission) OpenCode versions. --- src/agents/sisyphus.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/agents/sisyphus.ts b/src/agents/sisyphus.ts index fe45b68e..23ca8448 100644 --- a/src/agents/sisyphus.ts +++ b/src/agents/sisyphus.ts @@ -1,4 +1,5 @@ import type { AgentConfig } from "@opencode-ai/sdk" +import { createAgentToolRestrictions } from "../shared/permission-compat" import { isGptModel } from "./types" import type { AvailableAgent, AvailableTool, AvailableSkill } from "./sisyphus-prompt-builder" import { @@ -621,6 +622,7 @@ export function createSisyphusAgent( // Note: question permission allows agent to ask user questions via OpenCode's QuestionTool // SDK type doesn't include 'question' yet, but OpenCode runtime supports it const permission = { question: "allow" } as AgentConfig["permission"] + const restrictions = createAgentToolRestrictions(["call_omo_agent"]) const base = { description: "Sisyphus - Powerful AI orchestrator from OhMyOpenCode. Plans obsessively with todos, assesses search complexity before exploration, delegates strategically to specialized agents. Uses explore for internal code (parallel-friendly), librarian only for external docs, and always delegates UI work to frontend engineer.", @@ -630,7 +632,7 @@ export function createSisyphusAgent( prompt, color: "#00CED1", permission, - tools: { call_omo_agent: false }, + ...restrictions, } if (isGptModel(model)) {