Summary
Enable multi-agent workflows where a primary agent can delegate subtasks to specialized agents with different models or configurations.
Motivation
Complex tasks benefit from specialization:
- Use a fast/cheap model for simple subtasks (summarization, classification)
- Route reasoning-heavy tasks to a stronger model
- Parallel execution of independent subtasks
- Separation of concerns (research agent vs coding agent)
Requirements
delegate tool: spawn a sub-agent with a specific prompt and model
- Model routing: delegate to different provider/model combinations
- Context passing: share relevant context with sub-agents
- Result aggregation: collect and synthesize sub-agent outputs
- Recursion limits (prevent infinite delegation loops)
- Cost tracking per sub-agent
Configuration
[agents.researcher]
provider = "gemini"
model = "gemini-2.0-flash"
system_prompt = "You are a research assistant..."
[agents.coder]
provider = "openrouter"
model = "anthropic/claude-sonnet-4-20250514"
system_prompt = "You are a coding assistant..."
Implementation Notes
- Build on existing
RouterProvider hint system
- Sub-agents share the same tool registry
- Consider async execution with result futures
- Leverage
ReliableProvider for sub-agent calls
🤖 Generated with Claude Code
Summary
Enable multi-agent workflows where a primary agent can delegate subtasks to specialized agents with different models or configurations.
Motivation
Complex tasks benefit from specialization:
Requirements
delegatetool: spawn a sub-agent with a specific prompt and modelConfiguration
Implementation Notes
RouterProviderhint systemReliableProviderfor sub-agent calls🤖 Generated with Claude Code