Skip to content

WORKFLOW: Agents create MCP tasks but forget to invoke subagents - incomplete delegation pattern #12

@jerfowler

Description

@jerfowler

Incomplete Agent Delegation Pattern

Issue Summary

Severity: WORKFLOW
Impact: Agents create MCP tasks but fail to complete the delegation by actually invoking the subagent
Status: Process gap in agent coordination workflow

A common pattern has emerged where agents properly create MCP communication tasks for delegation but then forget the critical step of actually starting the target subagent, leaving tasks in limbo.

Related Issues & Solutions

🔗 Issue #25: Add flexible multi-task workflow support - Better task state management could detect "orphaned" tasks and warn when tasks are created but no progress occurs

🔗 Issue #26: Implement MCP Prompts for agent protocol guidance - Interactive prompts could provide step-by-step delegation checklists and remind agents of both delegation phases

🔗 Issue #27: Update PROTOCOL.md with enhanced task management capabilities - Clear documentation on complete delegation patterns will prevent confusion about what constitutes complete delegation

Note: These related issues address different aspects of the delegation problem and should resolve the incomplete delegation pattern when implemented.

Problem Pattern

What Happens (Incomplete Delegation)

// Step 1: Agent creates MCP task ✅
const task = await mcp__agent_comm__create_task({
  agent: "senior-backend-engineer",
  taskName: "Fix Critical Issues", 
  content: "Detailed task requirements...",
  taskType: "delegation"
});

// Step 2: Agent reports task created ✅
console.log("Task delegated to senior-backend-engineer");

// Step 3: Agent SHOULD invoke subagent but FORGETS ❌
// MISSING: Task(subagent_type="senior-backend-engineer", prompt="...")

// Result: Task exists but no agent is working on it ❌

What Should Happen (Complete Delegation)

// Step 1: Create MCP task ✅
const task = await mcp__agent_comm__create_task({...});

// Step 2: Actually start the subagent ✅
Task(
  subagent_type="senior-backend-engineer",
  prompt=`You have an assigned MCP task. Start with:
  mcp__agent_comm__check_tasks(agent="senior-backend-engineer")
  Then get context and begin work.`
);

// Step 3: Monitor progress ✅
// Later check: mcp__agent_comm__track_task_progress(...)

Root Cause Analysis

Cognitive Pattern

Agents treat MCP task creation as sufficient delegation, but it's only the setup phase:

  • MCP task creation = Preparation and communication
  • Task tool invocation = Actually starting the work
  • Both are required for complete delegation

Missing Mental Model

Agents need to understand the two-phase delegation pattern:

  1. Phase 1: Create MCP task (setup communication channel)
  2. Phase 2: Invoke subagent (start actual work)

Solutions in Progress

Issue #26: MCP Prompts Solution

Will provide interactive delegation guidance:

  • Step-by-step delegation checklists
  • Reminders about two-phase requirement
  • Real-time validation of delegation completeness

Issue #25: Multi-task Workflow Solution

Will detect orphaned tasks:

  • Task state monitoring to identify tasks with no progress
  • Automatic warnings for incomplete delegations
  • Better task lifecycle management

Issue #27: Documentation Solution

Will provide clear delegation patterns:

  • Standard delegation templates
  • Complete workflow examples
  • Training reinforcement for agents

Complete Delegation Template (Future)

/**
 * Complete Agent Delegation Pattern
 * Use this template for all subagent delegation
 */
async function delegateToAgent(targetAgent: string, taskName: string, requirements: string) {
  // Phase 1: Setup MCP communication
  const task = await mcp__agent_comm__create_task({
    agent: targetAgent,
    taskName: taskName,
    content: requirements,
    taskType: "delegation"
  });

  // Phase 2: Start subagent work (CRITICAL - don't forget this!)
  Task(
    subagent_type: targetAgent,
    prompt: `You have an assigned MCP task: ${task.taskId}
    
    Start with: mcp__agent_comm__check_tasks(agent="${targetAgent}")
    Then follow the MCP protocol for task execution.
    
    Requirements: ${requirements}`
  );

  return task;
}

Success Criteria

Priority: HIGH - Improves agent coordination reliability
Status: Will be resolved by Issues #25, #26, #27


📊 Meta-analysis of agent delegation patterns
🔗 Related to Issues #25, #26, #27 for comprehensive solution

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions