diff --git a/src/agents/dynamic-agent-prompt-builder.ts b/src/agents/dynamic-agent-prompt-builder.ts index ad44bc712..5685431b2 100644 --- a/src/agents/dynamic-agent-prompt-builder.ts +++ b/src/agents/dynamic-agent-prompt-builder.ts @@ -317,6 +317,22 @@ export function buildAntiPatternsSection(): string { ${patterns.join("\n")}` } +export function buildDeepParallelSection(model: string, categories: AvailableCategory[]): string { + const isNonClaude = !model.toLowerCase().includes('claude') + const hasDeepCategory = categories.some(c => c.name === 'deep') + + if (!isNonClaude || !hasDeepCategory) return "" + + return `### Deep Parallel Delegation + +For implementation tasks, actively decompose and delegate to \`deep\` category agents in parallel. + +1. Break the implementation into independent work units +2. Maximize parallel deep agents — spawn one per independent unit (\`run_in_background=true\`) +3. Give each agent a GOAL, not step-by-step instructions — deep agents explore and solve autonomously +4. Collect results, integrate, verify coherence` +} + export function buildUltraworkSection( agents: AvailableAgent[], categories: AvailableCategory[], diff --git a/src/agents/sisyphus.ts b/src/agents/sisyphus.ts index 47b2118de..dc035d998 100644 --- a/src/agents/sisyphus.ts +++ b/src/agents/sisyphus.ts @@ -25,6 +25,7 @@ import { buildOracleSection, buildHardBlocksSection, buildAntiPatternsSection, + buildDeepParallelSection, categorizeTools, } from "./dynamic-agent-prompt-builder"; @@ -139,6 +140,7 @@ Should I proceed with [recommendation], or would you prefer differently? } function buildDynamicSisyphusPrompt( + model: string, availableAgents: AvailableAgent[], availableTools: AvailableTool[] = [], availableSkills: AvailableSkill[] = [], @@ -161,6 +163,7 @@ function buildDynamicSisyphusPrompt( const oracleSection = buildOracleSection(availableAgents); const hardBlocks = buildHardBlocksSection(); const antiPatterns = buildAntiPatternsSection(); + const deepParallelSection = buildDeepParallelSection(model, availableCategories); const taskManagementSection = buildTaskManagementSection(useTaskSystem); const todoHookNote = useTaskSystem ? "YOUR TASK CREATION WOULD BE TRACKED BY HOOK([SYSTEM REMINDER - TASK CONTINUATION])" @@ -356,6 +359,8 @@ STOP searching when: ${categorySkillsGuide} +${deepParallelSection} + ${delegationTable} ### Delegation Prompt Structure (MANDATORY - ALL 6 sections): @@ -545,13 +550,14 @@ export function createSisyphusAgent( const categories = availableCategories ?? []; const prompt = availableAgents ? buildDynamicSisyphusPrompt( + model, availableAgents, tools, skills, categories, useTaskSystem, ) - : buildDynamicSisyphusPrompt([], tools, skills, categories, useTaskSystem); + : buildDynamicSisyphusPrompt(model, [], tools, skills, categories, useTaskSystem); const permission = { question: "allow",