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.
This commit is contained in:
YeonGyu-Kim
2026-01-13 21:00:00 +09:00
parent cddbd0d945
commit 8916a32ea0

View File

@@ -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)) {