feat(sisyphus): add deep parallel delegation section to prompt
Add buildDeepParallelSection() function that injects guidance for non-Claude
models on parallel deep agent delegation:
- Detect when model is non-Claude and 'deep' category is available
- Inject instructions to decompose tasks and delegate to deep agents in parallel
- Give goals, not step-by-step instructions to deep agents
- Update Sisyphus prompt builder to pass model and call new function
This helps GPT-based Sisyphus instances leverage deep agents more effectively
for complex implementation tasks.
🤖 Generated with assistance of OhMyOpenCode
This commit is contained in:
@@ -317,6 +317,22 @@ export function buildAntiPatternsSection(): string {
|
|||||||
${patterns.join("\n")}`
|
${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(
|
export function buildUltraworkSection(
|
||||||
agents: AvailableAgent[],
|
agents: AvailableAgent[],
|
||||||
categories: AvailableCategory[],
|
categories: AvailableCategory[],
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ import {
|
|||||||
buildOracleSection,
|
buildOracleSection,
|
||||||
buildHardBlocksSection,
|
buildHardBlocksSection,
|
||||||
buildAntiPatternsSection,
|
buildAntiPatternsSection,
|
||||||
|
buildDeepParallelSection,
|
||||||
categorizeTools,
|
categorizeTools,
|
||||||
} from "./dynamic-agent-prompt-builder";
|
} from "./dynamic-agent-prompt-builder";
|
||||||
|
|
||||||
@@ -139,6 +140,7 @@ Should I proceed with [recommendation], or would you prefer differently?
|
|||||||
}
|
}
|
||||||
|
|
||||||
function buildDynamicSisyphusPrompt(
|
function buildDynamicSisyphusPrompt(
|
||||||
|
model: string,
|
||||||
availableAgents: AvailableAgent[],
|
availableAgents: AvailableAgent[],
|
||||||
availableTools: AvailableTool[] = [],
|
availableTools: AvailableTool[] = [],
|
||||||
availableSkills: AvailableSkill[] = [],
|
availableSkills: AvailableSkill[] = [],
|
||||||
@@ -161,6 +163,7 @@ function buildDynamicSisyphusPrompt(
|
|||||||
const oracleSection = buildOracleSection(availableAgents);
|
const oracleSection = buildOracleSection(availableAgents);
|
||||||
const hardBlocks = buildHardBlocksSection();
|
const hardBlocks = buildHardBlocksSection();
|
||||||
const antiPatterns = buildAntiPatternsSection();
|
const antiPatterns = buildAntiPatternsSection();
|
||||||
|
const deepParallelSection = buildDeepParallelSection(model, availableCategories);
|
||||||
const taskManagementSection = buildTaskManagementSection(useTaskSystem);
|
const taskManagementSection = buildTaskManagementSection(useTaskSystem);
|
||||||
const todoHookNote = useTaskSystem
|
const todoHookNote = useTaskSystem
|
||||||
? "YOUR TASK CREATION WOULD BE TRACKED BY HOOK([SYSTEM REMINDER - TASK CONTINUATION])"
|
? "YOUR TASK CREATION WOULD BE TRACKED BY HOOK([SYSTEM REMINDER - TASK CONTINUATION])"
|
||||||
@@ -356,6 +359,8 @@ STOP searching when:
|
|||||||
|
|
||||||
${categorySkillsGuide}
|
${categorySkillsGuide}
|
||||||
|
|
||||||
|
${deepParallelSection}
|
||||||
|
|
||||||
${delegationTable}
|
${delegationTable}
|
||||||
|
|
||||||
### Delegation Prompt Structure (MANDATORY - ALL 6 sections):
|
### Delegation Prompt Structure (MANDATORY - ALL 6 sections):
|
||||||
@@ -545,13 +550,14 @@ export function createSisyphusAgent(
|
|||||||
const categories = availableCategories ?? [];
|
const categories = availableCategories ?? [];
|
||||||
const prompt = availableAgents
|
const prompt = availableAgents
|
||||||
? buildDynamicSisyphusPrompt(
|
? buildDynamicSisyphusPrompt(
|
||||||
|
model,
|
||||||
availableAgents,
|
availableAgents,
|
||||||
tools,
|
tools,
|
||||||
skills,
|
skills,
|
||||||
categories,
|
categories,
|
||||||
useTaskSystem,
|
useTaskSystem,
|
||||||
)
|
)
|
||||||
: buildDynamicSisyphusPrompt([], tools, skills, categories, useTaskSystem);
|
: buildDynamicSisyphusPrompt(model, [], tools, skills, categories, useTaskSystem);
|
||||||
|
|
||||||
const permission = {
|
const permission = {
|
||||||
question: "allow",
|
question: "allow",
|
||||||
|
|||||||
Reference in New Issue
Block a user