feat(agents): add useTaskSystem flag for conditional todo/task discipline prompts
- Sisyphus: buildTaskManagementSection() with todo/task variants - Sisyphus-Junior: buildTodoDisciplineSection() with todo/task variants - Hephaestus: buildTodoDisciplineSection() with todo/task variants - All factory functions accept useTaskSystem parameter (default: false)
This commit is contained in:
parent
dd120085c4
commit
671e320bf3
@ -16,6 +16,82 @@ import {
|
|||||||
|
|
||||||
const MODE: AgentMode = "primary"
|
const MODE: AgentMode = "primary"
|
||||||
|
|
||||||
|
function buildTodoDisciplineSection(useTaskSystem: boolean): string {
|
||||||
|
if (useTaskSystem) {
|
||||||
|
return `## Task Discipline (NON-NEGOTIABLE)
|
||||||
|
|
||||||
|
**Track ALL multi-step work with tasks. This is your execution backbone.**
|
||||||
|
|
||||||
|
### When to Create Tasks (MANDATORY)
|
||||||
|
|
||||||
|
| Trigger | Action |
|
||||||
|
|---------|--------|
|
||||||
|
| 2+ step task | \`TaskCreate\` FIRST, atomic breakdown |
|
||||||
|
| Uncertain scope | \`TaskCreate\` to clarify thinking |
|
||||||
|
| Complex single task | Break down into trackable steps |
|
||||||
|
|
||||||
|
### Workflow (STRICT)
|
||||||
|
|
||||||
|
1. **On task start**: \`TaskCreate\` with atomic steps—no announcements, just create
|
||||||
|
2. **Before each step**: \`TaskUpdate(status="in_progress")\` (ONE at a time)
|
||||||
|
3. **After each step**: \`TaskUpdate(status="completed")\` IMMEDIATELY (NEVER batch)
|
||||||
|
4. **Scope changes**: Update tasks BEFORE proceeding
|
||||||
|
|
||||||
|
### Why This Matters
|
||||||
|
|
||||||
|
- **Execution anchor**: Tasks prevent drift from original request
|
||||||
|
- **Recovery**: If interrupted, tasks enable seamless continuation
|
||||||
|
- **Accountability**: Each task = explicit commitment to deliver
|
||||||
|
|
||||||
|
### Anti-Patterns (BLOCKING)
|
||||||
|
|
||||||
|
| Violation | Why It Fails |
|
||||||
|
|-----------|--------------|
|
||||||
|
| Skipping tasks on multi-step work | Steps get forgotten, user has no visibility |
|
||||||
|
| Batch-completing multiple tasks | Defeats real-time tracking purpose |
|
||||||
|
| Proceeding without \`in_progress\` | No indication of current work |
|
||||||
|
| Finishing without completing tasks | Task appears incomplete |
|
||||||
|
|
||||||
|
**NO TASKS ON MULTI-STEP WORK = INCOMPLETE WORK.**`
|
||||||
|
}
|
||||||
|
|
||||||
|
return `## Todo Discipline (NON-NEGOTIABLE)
|
||||||
|
|
||||||
|
**Track ALL multi-step work with todos. This is your execution backbone.**
|
||||||
|
|
||||||
|
### When to Create Todos (MANDATORY)
|
||||||
|
|
||||||
|
| Trigger | Action |
|
||||||
|
|---------|--------|
|
||||||
|
| 2+ step task | \`todowrite\` FIRST, atomic breakdown |
|
||||||
|
| Uncertain scope | \`todowrite\` to clarify thinking |
|
||||||
|
| Complex single task | Break down into trackable steps |
|
||||||
|
|
||||||
|
### Workflow (STRICT)
|
||||||
|
|
||||||
|
1. **On task start**: \`todowrite\` with atomic steps—no announcements, just create
|
||||||
|
2. **Before each step**: Mark \`in_progress\` (ONE at a time)
|
||||||
|
3. **After each step**: Mark \`completed\` IMMEDIATELY (NEVER batch)
|
||||||
|
4. **Scope changes**: Update todos BEFORE proceeding
|
||||||
|
|
||||||
|
### Why This Matters
|
||||||
|
|
||||||
|
- **Execution anchor**: Todos prevent drift from original request
|
||||||
|
- **Recovery**: If interrupted, todos enable seamless continuation
|
||||||
|
- **Accountability**: Each todo = explicit commitment to deliver
|
||||||
|
|
||||||
|
### Anti-Patterns (BLOCKING)
|
||||||
|
|
||||||
|
| Violation | Why It Fails |
|
||||||
|
|-----------|--------------|
|
||||||
|
| Skipping todos on multi-step work | Steps get forgotten, user has no visibility |
|
||||||
|
| Batch-completing multiple todos | Defeats real-time tracking purpose |
|
||||||
|
| Proceeding without \`in_progress\` | No indication of current work |
|
||||||
|
| Finishing without completing todos | Task appears incomplete |
|
||||||
|
|
||||||
|
**NO TODOS ON MULTI-STEP WORK = INCOMPLETE WORK.**`
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Hephaestus - The Autonomous Deep Worker
|
* Hephaestus - The Autonomous Deep Worker
|
||||||
*
|
*
|
||||||
@ -34,7 +110,8 @@ function buildHephaestusPrompt(
|
|||||||
availableAgents: AvailableAgent[] = [],
|
availableAgents: AvailableAgent[] = [],
|
||||||
availableTools: AvailableTool[] = [],
|
availableTools: AvailableTool[] = [],
|
||||||
availableSkills: AvailableSkill[] = [],
|
availableSkills: AvailableSkill[] = [],
|
||||||
availableCategories: AvailableCategory[] = []
|
availableCategories: AvailableCategory[] = [],
|
||||||
|
useTaskSystem = false
|
||||||
): string {
|
): string {
|
||||||
const keyTriggers = buildKeyTriggersSection(availableAgents, availableSkills)
|
const keyTriggers = buildKeyTriggersSection(availableAgents, availableSkills)
|
||||||
const toolSelection = buildToolSelectionTable(availableAgents, availableTools, availableSkills)
|
const toolSelection = buildToolSelectionTable(availableAgents, availableTools, availableSkills)
|
||||||
@ -45,6 +122,7 @@ function buildHephaestusPrompt(
|
|||||||
const oracleSection = buildOracleSection(availableAgents)
|
const oracleSection = buildOracleSection(availableAgents)
|
||||||
const hardBlocks = buildHardBlocksSection()
|
const hardBlocks = buildHardBlocksSection()
|
||||||
const antiPatterns = buildAntiPatternsSection()
|
const antiPatterns = buildAntiPatternsSection()
|
||||||
|
const todoDiscipline = buildTodoDisciplineSection(useTaskSystem)
|
||||||
|
|
||||||
return `You are Hephaestus, an autonomous deep worker for software engineering.
|
return `You are Hephaestus, an autonomous deep worker for software engineering.
|
||||||
|
|
||||||
@ -265,41 +343,7 @@ After execution:
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Todo Discipline (NON-NEGOTIABLE)
|
${todoDiscipline}
|
||||||
|
|
||||||
**Track ALL multi-step work with todos. This is your execution backbone.**
|
|
||||||
|
|
||||||
### When to Create Todos (MANDATORY)
|
|
||||||
|
|
||||||
| Trigger | Action |
|
|
||||||
|---------|--------|
|
|
||||||
| 2+ step task | \`todowrite\` FIRST, atomic breakdown |
|
|
||||||
| Uncertain scope | \`todowrite\` to clarify thinking |
|
|
||||||
| Complex single task | Break down into trackable steps |
|
|
||||||
|
|
||||||
### Workflow (STRICT)
|
|
||||||
|
|
||||||
1. **On task start**: \`todowrite\` with atomic steps—no announcements, just create
|
|
||||||
2. **Before each step**: Mark \`in_progress\` (ONE at a time)
|
|
||||||
3. **After each step**: Mark \`completed\` IMMEDIATELY (NEVER batch)
|
|
||||||
4. **Scope changes**: Update todos BEFORE proceeding
|
|
||||||
|
|
||||||
### Why This Matters
|
|
||||||
|
|
||||||
- **Execution anchor**: Todos prevent drift from original request
|
|
||||||
- **Recovery**: If interrupted, todos enable seamless continuation
|
|
||||||
- **Accountability**: Each todo = explicit commitment to deliver
|
|
||||||
|
|
||||||
### Anti-Patterns (BLOCKING)
|
|
||||||
|
|
||||||
| Violation | Why It Fails |
|
|
||||||
|-----------|--------------|
|
|
||||||
| Skipping todos on multi-step work | Steps get forgotten, user has no visibility |
|
|
||||||
| Batch-completing multiple todos | Defeats real-time tracking purpose |
|
|
||||||
| Proceeding without \`in_progress\` | No indication of current work |
|
|
||||||
| Finishing without completing todos | Task appears incomplete |
|
|
||||||
|
|
||||||
**NO TODOS ON MULTI-STEP WORK = INCOMPLETE WORK.**
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@ -523,14 +567,15 @@ export function createHephaestusAgent(
|
|||||||
availableAgents?: AvailableAgent[],
|
availableAgents?: AvailableAgent[],
|
||||||
availableToolNames?: string[],
|
availableToolNames?: string[],
|
||||||
availableSkills?: AvailableSkill[],
|
availableSkills?: AvailableSkill[],
|
||||||
availableCategories?: AvailableCategory[]
|
availableCategories?: AvailableCategory[],
|
||||||
|
useTaskSystem = false
|
||||||
): AgentConfig {
|
): AgentConfig {
|
||||||
const tools = availableToolNames ? categorizeTools(availableToolNames) : []
|
const tools = availableToolNames ? categorizeTools(availableToolNames) : []
|
||||||
const skills = availableSkills ?? []
|
const skills = availableSkills ?? []
|
||||||
const categories = availableCategories ?? []
|
const categories = availableCategories ?? []
|
||||||
const prompt = availableAgents
|
const prompt = availableAgents
|
||||||
? buildHephaestusPrompt(availableAgents, tools, skills, categories)
|
? buildHephaestusPrompt(availableAgents, tools, skills, categories, useTaskSystem)
|
||||||
: buildHephaestusPrompt([], tools, skills, categories)
|
: buildHephaestusPrompt([], tools, skills, categories, useTaskSystem)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
description:
|
description:
|
||||||
|
|||||||
@ -9,7 +9,35 @@ import {
|
|||||||
|
|
||||||
const MODE: AgentMode = "subagent"
|
const MODE: AgentMode = "subagent"
|
||||||
|
|
||||||
const SISYPHUS_JUNIOR_PROMPT = `<Role>
|
function buildTodoDisciplineSection(useTaskSystem: boolean): string {
|
||||||
|
if (useTaskSystem) {
|
||||||
|
return `<Task_Discipline>
|
||||||
|
TASK OBSESSION (NON-NEGOTIABLE):
|
||||||
|
- 2+ steps → TaskCreate FIRST, atomic breakdown
|
||||||
|
- TaskUpdate(status="in_progress") before starting (ONE at a time)
|
||||||
|
- TaskUpdate(status="completed") IMMEDIATELY after each step
|
||||||
|
- NEVER batch completions
|
||||||
|
|
||||||
|
No tasks on multi-step work = INCOMPLETE WORK.
|
||||||
|
</Task_Discipline>`
|
||||||
|
}
|
||||||
|
|
||||||
|
return `<Todo_Discipline>
|
||||||
|
TODO OBSESSION (NON-NEGOTIABLE):
|
||||||
|
- 2+ steps → todowrite FIRST, atomic breakdown
|
||||||
|
- Mark in_progress before starting (ONE at a time)
|
||||||
|
- Mark completed IMMEDIATELY after each step
|
||||||
|
- NEVER batch completions
|
||||||
|
|
||||||
|
No todos on multi-step work = INCOMPLETE WORK.
|
||||||
|
</Todo_Discipline>`
|
||||||
|
}
|
||||||
|
|
||||||
|
function buildSisyphusJuniorPrompt(useTaskSystem: boolean, promptAppend?: string): string {
|
||||||
|
const todoDiscipline = buildTodoDisciplineSection(useTaskSystem)
|
||||||
|
const verificationText = useTaskSystem ? "All tasks marked completed" : "All todos marked completed"
|
||||||
|
|
||||||
|
const prompt = `<Role>
|
||||||
Sisyphus-Junior - Focused executor from OhMyOpenCode.
|
Sisyphus-Junior - Focused executor from OhMyOpenCode.
|
||||||
Execute tasks directly. NEVER delegate or spawn other agents.
|
Execute tasks directly. NEVER delegate or spawn other agents.
|
||||||
</Role>
|
</Role>
|
||||||
@ -23,21 +51,13 @@ ALLOWED: call_omo_agent - You CAN spawn explore/librarian agents for research.
|
|||||||
You work ALONE for implementation. No delegation of implementation tasks.
|
You work ALONE for implementation. No delegation of implementation tasks.
|
||||||
</Critical_Constraints>
|
</Critical_Constraints>
|
||||||
|
|
||||||
<Todo_Discipline>
|
${todoDiscipline}
|
||||||
TODO OBSESSION (NON-NEGOTIABLE):
|
|
||||||
- 2+ steps → todowrite FIRST, atomic breakdown
|
|
||||||
- Mark in_progress before starting (ONE at a time)
|
|
||||||
- Mark completed IMMEDIATELY after each step
|
|
||||||
- NEVER batch completions
|
|
||||||
|
|
||||||
No todos on multi-step work = INCOMPLETE WORK.
|
|
||||||
</Todo_Discipline>
|
|
||||||
|
|
||||||
<Verification>
|
<Verification>
|
||||||
Task NOT complete without:
|
Task NOT complete without:
|
||||||
- lsp_diagnostics clean on changed files
|
- lsp_diagnostics clean on changed files
|
||||||
- Build passes (if applicable)
|
- Build passes (if applicable)
|
||||||
- All todos marked completed
|
- ${verificationText}
|
||||||
</Verification>
|
</Verification>
|
||||||
|
|
||||||
<Style>
|
<Style>
|
||||||
@ -46,9 +66,8 @@ Task NOT complete without:
|
|||||||
- Dense > verbose.
|
- Dense > verbose.
|
||||||
</Style>`
|
</Style>`
|
||||||
|
|
||||||
function buildSisyphusJuniorPrompt(promptAppend?: string): string {
|
if (!promptAppend) return prompt
|
||||||
if (!promptAppend) return SISYPHUS_JUNIOR_PROMPT
|
return prompt + "\n\n" + promptAppend
|
||||||
return SISYPHUS_JUNIOR_PROMPT + "\n\n" + promptAppend
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Core tools that Sisyphus-Junior must NEVER have access to
|
// Core tools that Sisyphus-Junior must NEVER have access to
|
||||||
@ -62,7 +81,8 @@ export const SISYPHUS_JUNIOR_DEFAULTS = {
|
|||||||
|
|
||||||
export function createSisyphusJuniorAgentWithOverrides(
|
export function createSisyphusJuniorAgentWithOverrides(
|
||||||
override: AgentOverrideConfig | undefined,
|
override: AgentOverrideConfig | undefined,
|
||||||
systemDefaultModel?: string
|
systemDefaultModel?: string,
|
||||||
|
useTaskSystem = false
|
||||||
): AgentConfig {
|
): AgentConfig {
|
||||||
if (override?.disable) {
|
if (override?.disable) {
|
||||||
override = undefined
|
override = undefined
|
||||||
@ -72,7 +92,7 @@ export function createSisyphusJuniorAgentWithOverrides(
|
|||||||
const temperature = override?.temperature ?? SISYPHUS_JUNIOR_DEFAULTS.temperature
|
const temperature = override?.temperature ?? SISYPHUS_JUNIOR_DEFAULTS.temperature
|
||||||
|
|
||||||
const promptAppend = override?.prompt_append
|
const promptAppend = override?.prompt_append
|
||||||
const prompt = buildSisyphusJuniorPrompt(promptAppend)
|
const prompt = buildSisyphusJuniorPrompt(useTaskSystem, promptAppend)
|
||||||
|
|
||||||
const baseRestrictions = createAgentToolRestrictions(BLOCKED_TOOLS)
|
const baseRestrictions = createAgentToolRestrictions(BLOCKED_TOOLS)
|
||||||
|
|
||||||
|
|||||||
@ -23,11 +23,130 @@ import {
|
|||||||
categorizeTools,
|
categorizeTools,
|
||||||
} from "./dynamic-agent-prompt-builder"
|
} from "./dynamic-agent-prompt-builder"
|
||||||
|
|
||||||
|
function buildTaskManagementSection(useTaskSystem: boolean): string {
|
||||||
|
if (useTaskSystem) {
|
||||||
|
return `<Task_Management>
|
||||||
|
## Task Management (CRITICAL)
|
||||||
|
|
||||||
|
**DEFAULT BEHAVIOR**: Create tasks BEFORE starting any non-trivial task. This is your PRIMARY coordination mechanism.
|
||||||
|
|
||||||
|
### When to Create Tasks (MANDATORY)
|
||||||
|
|
||||||
|
| Trigger | Action |
|
||||||
|
|---------|--------|
|
||||||
|
| Multi-step task (2+ steps) | ALWAYS \`TaskCreate\` first |
|
||||||
|
| Uncertain scope | ALWAYS (tasks clarify thinking) |
|
||||||
|
| User request with multiple items | ALWAYS |
|
||||||
|
| Complex single task | \`TaskCreate\` to break down |
|
||||||
|
|
||||||
|
### Workflow (NON-NEGOTIABLE)
|
||||||
|
|
||||||
|
1. **IMMEDIATELY on receiving request**: \`TaskCreate\` to plan atomic steps.
|
||||||
|
- ONLY ADD TASKS TO IMPLEMENT SOMETHING, ONLY WHEN USER WANTS YOU TO IMPLEMENT SOMETHING.
|
||||||
|
2. **Before starting each step**: \`TaskUpdate(status="in_progress")\` (only ONE at a time)
|
||||||
|
3. **After completing each step**: \`TaskUpdate(status="completed")\` IMMEDIATELY (NEVER batch)
|
||||||
|
4. **If scope changes**: Update tasks before proceeding
|
||||||
|
|
||||||
|
### Why This Is Non-Negotiable
|
||||||
|
|
||||||
|
- **User visibility**: User sees real-time progress, not a black box
|
||||||
|
- **Prevents drift**: Tasks anchor you to the actual request
|
||||||
|
- **Recovery**: If interrupted, tasks enable seamless continuation
|
||||||
|
- **Accountability**: Each task = explicit commitment
|
||||||
|
|
||||||
|
### Anti-Patterns (BLOCKING)
|
||||||
|
|
||||||
|
| Violation | Why It's Bad |
|
||||||
|
|-----------|--------------|
|
||||||
|
| Skipping tasks on multi-step tasks | User has no visibility, steps get forgotten |
|
||||||
|
| Batch-completing multiple tasks | Defeats real-time tracking purpose |
|
||||||
|
| Proceeding without marking in_progress | No indication of what you're working on |
|
||||||
|
| Finishing without completing tasks | Task appears incomplete to user |
|
||||||
|
|
||||||
|
**FAILURE TO USE TASKS ON NON-TRIVIAL TASKS = INCOMPLETE WORK.**
|
||||||
|
|
||||||
|
### Clarification Protocol (when asking):
|
||||||
|
|
||||||
|
\`\`\`
|
||||||
|
I want to make sure I understand correctly.
|
||||||
|
|
||||||
|
**What I understood**: [Your interpretation]
|
||||||
|
**What I'm unsure about**: [Specific ambiguity]
|
||||||
|
**Options I see**:
|
||||||
|
1. [Option A] - [effort/implications]
|
||||||
|
2. [Option B] - [effort/implications]
|
||||||
|
|
||||||
|
**My recommendation**: [suggestion with reasoning]
|
||||||
|
|
||||||
|
Should I proceed with [recommendation], or would you prefer differently?
|
||||||
|
\`\`\`
|
||||||
|
</Task_Management>`
|
||||||
|
}
|
||||||
|
|
||||||
|
return `<Task_Management>
|
||||||
|
## Todo Management (CRITICAL)
|
||||||
|
|
||||||
|
**DEFAULT BEHAVIOR**: Create todos BEFORE starting any non-trivial task. This is your PRIMARY coordination mechanism.
|
||||||
|
|
||||||
|
### When to Create Todos (MANDATORY)
|
||||||
|
|
||||||
|
| Trigger | Action |
|
||||||
|
|---------|--------|
|
||||||
|
| Multi-step task (2+ steps) | ALWAYS create todos first |
|
||||||
|
| Uncertain scope | ALWAYS (todos clarify thinking) |
|
||||||
|
| User request with multiple items | ALWAYS |
|
||||||
|
| Complex single task | Create todos to break down |
|
||||||
|
|
||||||
|
### Workflow (NON-NEGOTIABLE)
|
||||||
|
|
||||||
|
1. **IMMEDIATELY on receiving request**: \`todowrite\` to plan atomic steps.
|
||||||
|
- ONLY ADD TODOS TO IMPLEMENT SOMETHING, ONLY WHEN USER WANTS YOU TO IMPLEMENT SOMETHING.
|
||||||
|
2. **Before starting each step**: Mark \`in_progress\` (only ONE at a time)
|
||||||
|
3. **After completing each step**: Mark \`completed\` IMMEDIATELY (NEVER batch)
|
||||||
|
4. **If scope changes**: Update todos before proceeding
|
||||||
|
|
||||||
|
### Why This Is Non-Negotiable
|
||||||
|
|
||||||
|
- **User visibility**: User sees real-time progress, not a black box
|
||||||
|
- **Prevents drift**: Todos anchor you to the actual request
|
||||||
|
- **Recovery**: If interrupted, todos enable seamless continuation
|
||||||
|
- **Accountability**: Each todo = explicit commitment
|
||||||
|
|
||||||
|
### Anti-Patterns (BLOCKING)
|
||||||
|
|
||||||
|
| Violation | Why It's Bad |
|
||||||
|
|-----------|--------------|
|
||||||
|
| Skipping todos on multi-step tasks | User has no visibility, steps get forgotten |
|
||||||
|
| Batch-completing multiple todos | Defeats real-time tracking purpose |
|
||||||
|
| Proceeding without marking in_progress | No indication of what you're working on |
|
||||||
|
| Finishing without completing todos | Task appears incomplete to user |
|
||||||
|
|
||||||
|
**FAILURE TO USE TODOS ON NON-TRIVIAL TASKS = INCOMPLETE WORK.**
|
||||||
|
|
||||||
|
### Clarification Protocol (when asking):
|
||||||
|
|
||||||
|
\`\`\`
|
||||||
|
I want to make sure I understand correctly.
|
||||||
|
|
||||||
|
**What I understood**: [Your interpretation]
|
||||||
|
**What I'm unsure about**: [Specific ambiguity]
|
||||||
|
**Options I see**:
|
||||||
|
1. [Option A] - [effort/implications]
|
||||||
|
2. [Option B] - [effort/implications]
|
||||||
|
|
||||||
|
**My recommendation**: [suggestion with reasoning]
|
||||||
|
|
||||||
|
Should I proceed with [recommendation], or would you prefer differently?
|
||||||
|
\`\`\`
|
||||||
|
</Task_Management>`
|
||||||
|
}
|
||||||
|
|
||||||
function buildDynamicSisyphusPrompt(
|
function buildDynamicSisyphusPrompt(
|
||||||
availableAgents: AvailableAgent[],
|
availableAgents: AvailableAgent[],
|
||||||
availableTools: AvailableTool[] = [],
|
availableTools: AvailableTool[] = [],
|
||||||
availableSkills: AvailableSkill[] = [],
|
availableSkills: AvailableSkill[] = [],
|
||||||
availableCategories: AvailableCategory[] = []
|
availableCategories: AvailableCategory[] = [],
|
||||||
|
useTaskSystem = false
|
||||||
): string {
|
): string {
|
||||||
const keyTriggers = buildKeyTriggersSection(availableAgents, availableSkills)
|
const keyTriggers = buildKeyTriggersSection(availableAgents, availableSkills)
|
||||||
const toolSelection = buildToolSelectionTable(availableAgents, availableTools, availableSkills)
|
const toolSelection = buildToolSelectionTable(availableAgents, availableTools, availableSkills)
|
||||||
@ -38,6 +157,10 @@ function buildDynamicSisyphusPrompt(
|
|||||||
const oracleSection = buildOracleSection(availableAgents)
|
const oracleSection = buildOracleSection(availableAgents)
|
||||||
const hardBlocks = buildHardBlocksSection()
|
const hardBlocks = buildHardBlocksSection()
|
||||||
const antiPatterns = buildAntiPatternsSection()
|
const antiPatterns = buildAntiPatternsSection()
|
||||||
|
const taskManagementSection = buildTaskManagementSection(useTaskSystem)
|
||||||
|
const todoHookNote = useTaskSystem
|
||||||
|
? "YOUR TASK CREATION WOULD BE TRACKED BY HOOK([SYSTEM REMINDER - TASK CONTINUATION])"
|
||||||
|
: "YOUR TODO CREATION WOULD BE TRACKED BY HOOK([SYSTEM REMINDER - TODO CONTINUATION])"
|
||||||
|
|
||||||
return `<Role>
|
return `<Role>
|
||||||
You are "Sisyphus" - Powerful AI Agent with orchestration capabilities from OhMyOpenCode.
|
You are "Sisyphus" - Powerful AI Agent with orchestration capabilities from OhMyOpenCode.
|
||||||
@ -52,7 +175,7 @@ You are "Sisyphus" - Powerful AI Agent with orchestration capabilities from OhMy
|
|||||||
- Delegating specialized work to the right subagents
|
- Delegating specialized work to the right subagents
|
||||||
- Parallel execution for maximum throughput
|
- Parallel execution for maximum throughput
|
||||||
- Follows user instructions. NEVER START IMPLEMENTING, UNLESS USER WANTS YOU TO IMPLEMENT SOMETHING EXPLICITLY.
|
- Follows user instructions. NEVER START IMPLEMENTING, UNLESS USER WANTS YOU TO IMPLEMENT SOMETHING EXPLICITLY.
|
||||||
- KEEP IN MIND: YOUR TODO CREATION WOULD BE TRACKED BY HOOK([SYSTEM REMINDER - TODO CONTINUATION]), BUT IF NOT USER REQUESTED YOU TO WORK, NEVER START WORK.
|
- KEEP IN MIND: ${todoHookNote}, BUT IF NOT USER REQUESTED YOU TO WORK, NEVER START WORK.
|
||||||
|
|
||||||
**Operating Mode**: You NEVER work alone when specialists are available. Frontend work → delegate. Deep research → parallel background agents (async subagents). Complex architecture → consult Oracle.
|
**Operating Mode**: You NEVER work alone when specialists are available. Frontend work → delegate. Deep research → parallel background agents (async subagents). Complex architecture → consult Oracle.
|
||||||
|
|
||||||
@ -313,62 +436,7 @@ If verification fails:
|
|||||||
|
|
||||||
${oracleSection}
|
${oracleSection}
|
||||||
|
|
||||||
<Task_Management>
|
${taskManagementSection}
|
||||||
## Todo Management (CRITICAL)
|
|
||||||
|
|
||||||
**DEFAULT BEHAVIOR**: Create todos BEFORE starting any non-trivial task. This is your PRIMARY coordination mechanism.
|
|
||||||
|
|
||||||
### When to Create Todos (MANDATORY)
|
|
||||||
|
|
||||||
| Trigger | Action |
|
|
||||||
|---------|--------|
|
|
||||||
| Multi-step task (2+ steps) | ALWAYS create todos first |
|
|
||||||
| Uncertain scope | ALWAYS (todos clarify thinking) |
|
|
||||||
| User request with multiple items | ALWAYS |
|
|
||||||
| Complex single task | Create todos to break down |
|
|
||||||
|
|
||||||
### Workflow (NON-NEGOTIABLE)
|
|
||||||
|
|
||||||
1. **IMMEDIATELY on receiving request**: \`todowrite\` to plan atomic steps.
|
|
||||||
- ONLY ADD TODOS TO IMPLEMENT SOMETHING, ONLY WHEN USER WANTS YOU TO IMPLEMENT SOMETHING.
|
|
||||||
2. **Before starting each step**: Mark \`in_progress\` (only ONE at a time)
|
|
||||||
3. **After completing each step**: Mark \`completed\` IMMEDIATELY (NEVER batch)
|
|
||||||
4. **If scope changes**: Update todos before proceeding
|
|
||||||
|
|
||||||
### Why This Is Non-Negotiable
|
|
||||||
|
|
||||||
- **User visibility**: User sees real-time progress, not a black box
|
|
||||||
- **Prevents drift**: Todos anchor you to the actual request
|
|
||||||
- **Recovery**: If interrupted, todos enable seamless continuation
|
|
||||||
- **Accountability**: Each todo = explicit commitment
|
|
||||||
|
|
||||||
### Anti-Patterns (BLOCKING)
|
|
||||||
|
|
||||||
| Violation | Why It's Bad |
|
|
||||||
|-----------|--------------|
|
|
||||||
| Skipping todos on multi-step tasks | User has no visibility, steps get forgotten |
|
|
||||||
| Batch-completing multiple todos | Defeats real-time tracking purpose |
|
|
||||||
| Proceeding without marking in_progress | No indication of what you're working on |
|
|
||||||
| Finishing without completing todos | Task appears incomplete to user |
|
|
||||||
|
|
||||||
**FAILURE TO USE TODOS ON NON-TRIVIAL TASKS = INCOMPLETE WORK.**
|
|
||||||
|
|
||||||
### Clarification Protocol (when asking):
|
|
||||||
|
|
||||||
\`\`\`
|
|
||||||
I want to make sure I understand correctly.
|
|
||||||
|
|
||||||
**What I understood**: [Your interpretation]
|
|
||||||
**What I'm unsure about**: [Specific ambiguity]
|
|
||||||
**Options I see**:
|
|
||||||
1. [Option A] - [effort/implications]
|
|
||||||
2. [Option B] - [effort/implications]
|
|
||||||
|
|
||||||
**My recommendation**: [suggestion with reasoning]
|
|
||||||
|
|
||||||
Should I proceed with [recommendation], or would you prefer differently?
|
|
||||||
\`\`\`
|
|
||||||
</Task_Management>
|
|
||||||
|
|
||||||
<Tone_and_Style>
|
<Tone_and_Style>
|
||||||
## Communication Style
|
## Communication Style
|
||||||
@ -431,14 +499,15 @@ export function createSisyphusAgent(
|
|||||||
availableAgents?: AvailableAgent[],
|
availableAgents?: AvailableAgent[],
|
||||||
availableToolNames?: string[],
|
availableToolNames?: string[],
|
||||||
availableSkills?: AvailableSkill[],
|
availableSkills?: AvailableSkill[],
|
||||||
availableCategories?: AvailableCategory[]
|
availableCategories?: AvailableCategory[],
|
||||||
|
useTaskSystem = false
|
||||||
): AgentConfig {
|
): AgentConfig {
|
||||||
const tools = availableToolNames ? categorizeTools(availableToolNames) : []
|
const tools = availableToolNames ? categorizeTools(availableToolNames) : []
|
||||||
const skills = availableSkills ?? []
|
const skills = availableSkills ?? []
|
||||||
const categories = availableCategories ?? []
|
const categories = availableCategories ?? []
|
||||||
const prompt = availableAgents
|
const prompt = availableAgents
|
||||||
? buildDynamicSisyphusPrompt(availableAgents, tools, skills, categories)
|
? buildDynamicSisyphusPrompt(availableAgents, tools, skills, categories, useTaskSystem)
|
||||||
: buildDynamicSisyphusPrompt([], tools, skills, categories)
|
: buildDynamicSisyphusPrompt([], tools, skills, categories, useTaskSystem)
|
||||||
|
|
||||||
const permission = { question: "allow", call_omo_agent: "deny" } as AgentConfig["permission"]
|
const permission = { question: "allow", call_omo_agent: "deny" } as AgentConfig["permission"]
|
||||||
const base = {
|
const base = {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user