diff --git a/src/tools/delegate-task/constants.ts b/src/tools/delegate-task/constants.ts index b7457bcb1..3d94c90eb 100644 --- a/src/tools/delegate-task/constants.ts +++ b/src/tools/delegate-task/constants.ts @@ -2,6 +2,7 @@ import type { AvailableCategory, AvailableSkill, } from "../../agents/dynamic-agent-prompt-builder" +import { getAgentConfigKey } from "../../shared/agent-display-names" import { truncateDescription } from "../../shared/truncate-description" export { CATEGORY_DESCRIPTIONS, @@ -329,18 +330,18 @@ export function isPlanAgent(agentName: string | undefined): boolean { } /** - * Plan family: plan + prometheus. Shares mutual delegation blocking only. - * Does NOT share system prompt or task permission (only isPlanAgent controls those). + * Plan family: plan + prometheus. Shares mutual delegation blocking and task tool permission. + * Does NOT share system prompt (only isPlanAgent controls that). */ export const PLAN_FAMILY_NAMES = ["plan", "prometheus"] /** - * Check if the given agent belongs to the plan family for mutual delegation blocking. + * Check if the given agent belongs to the plan family (blocking + task permission). */ export function isPlanFamily(category: string): boolean export function isPlanFamily(category: string | undefined): boolean export function isPlanFamily(category: string | undefined): boolean { if (!category) return false - const lowerCategory = category.toLowerCase().trim() + const lowerCategory = getAgentConfigKey(category).toLowerCase().trim() return PLAN_FAMILY_NAMES.some((name) => lowerCategory === name) } diff --git a/src/tools/delegate-task/sync-continuation.ts b/src/tools/delegate-task/sync-continuation.ts index 10bb09cdc..fa6f9f022 100644 --- a/src/tools/delegate-task/sync-continuation.ts +++ b/src/tools/delegate-task/sync-continuation.ts @@ -1,6 +1,6 @@ import type { DelegateTaskArgs, ToolContextWithMetadata } from "./types" import type { ExecutorContext, SessionMessage } from "./executor-types" -import { isPlanAgent } from "./constants" +import { isPlanFamily } from "./constants" import { storeToolMetadata } from "../../features/tool-metadata-store" import { resolveCallID } from "./resolve-call-id" import { getTaskToastManager } from "../../features/task-toast-manager" @@ -84,7 +84,7 @@ export async function executeSyncContinuation( storeToolMetadata(ctx.sessionID, callID, syncContMeta) } - const allowTask = isPlanAgent(resumeAgent) + const allowTask = isPlanFamily(resumeAgent) const tddEnabled = sisyphusAgentConfig?.tdd const effectivePrompt = buildTaskPrompt(args.prompt, resumeAgent, tddEnabled) const tools = { diff --git a/src/tools/delegate-task/sync-prompt-sender.ts b/src/tools/delegate-task/sync-prompt-sender.ts index 949ab4cc6..bd38830e5 100644 --- a/src/tools/delegate-task/sync-prompt-sender.ts +++ b/src/tools/delegate-task/sync-prompt-sender.ts @@ -1,6 +1,6 @@ import type { DelegateTaskArgs, OpencodeClient, DelegatedModelConfig } from "./types" import type { SisyphusAgentConfig } from "../../config/schema" -import { isPlanAgent } from "./constants" +import { isPlanFamily } from "./constants" import { buildTaskPrompt } from "./prompt-builder" import { promptSyncWithModelSuggestionRetry, @@ -64,7 +64,7 @@ export async function sendSyncPrompt( }, deps: SendSyncPromptDeps = sendSyncPromptDeps ): Promise { - const allowTask = isPlanAgent(input.agentToUse) + const allowTask = isPlanFamily(input.agentToUse) const tddEnabled = input.sisyphusAgentConfig?.tdd const effectivePrompt = buildTaskPrompt(input.args.prompt, input.agentToUse, tddEnabled) const tools = {