The runSubagent tool enables orchestration within VS Code:
// Good: Clear task with expected outputawaitrunSubagent({
prompt: `Search the codebase for all error handling patterns.
Return a JSON array of: {file, line, pattern, quality}`,
description: "Find error patterns"
user-invokable: false
});
// Bad: Vague delegationawaitrunSubagent({
prompt: "Look for problems in the code", // Too vaguedescription: "Find issues"
user-invokable: false
});
When to Use Subagent vs Direct
Scenario
Approach
Simple search
Direct grep_search
Complex multi-step search
runSubagent
Single file edit
Direct replace_string_in_file
Multi-file coordinated change
Consider subagent for planning
Research + implementation
Subagent for research, direct for implementation
Common Anti-Patterns
❌ Over-Orchestration
Problem: Using multiple agents for simple tasks
Symptom: Slower, more expensive, no quality gain
Fix: Trust capable models for multi-step tasks up to complexity threshold
❌ Insufficient Context
Problem: Agents lack needed information
Symptom: Repeated clarification requests, wrong assumptions
Fix: Front-load context in delegation prompt
❌ No Synthesis Strategy
Problem: Raw agent outputs dumped on user
Symptom: User must manually integrate results
Fix: Plan synthesis before decomposition
❌ Circular Dependencies
Problem: Agent A needs B's output, B needs A's output
Symptom: Deadlock or infinite loops
Fix: Identify and break cycles in task graph
Framework Landscape (2026)
Framework
Strength
Use Case
LangGraph
State machines, cycles
Complex workflows
AutoGen
Conversation patterns
Research, debate
CrewAI
Role-based teams
Business processes
VS Code Agents
IDE integration
Code tasks
Semantic Kernel
.NET native
Enterprise C#
Alex-Specific Patterns
Heir Orchestration
Master Alex can coordinate heirs for cross-platform tasks:
Master Alex (orchestrator)
├── VS Code Heir → code analysis
├── M365 Heir → document synthesis
└── Global Knowledge → pattern matching
Skill Selection as Orchestration
When Alex runs Skill Selection Optimization (SSO), it's a form of self-orchestration: