When to Delegate
Good candidates for delegation:- Reasoning-heavy subtasks (debugging, code review, research synthesis)
- Tasks that would flood your context with intermediate data
- Parallel independent workstreams (research A and B simultaneously)
- Fresh-context tasks where you want the agent to approach without bias
- Single tool call → just use the tool directly
- Mechanical multi-step work with logic between steps →
execute_code - Tasks needing user interaction → subagents can’t use
clarify - Quick file edits → do them directly
- Durable long-running work that must survive session closure or process restart →
cronjob_manageorterminal(background=True, notify_on_complete=True). Top-level delegation is asynchronous but still process-local.
Pattern: Parallel Research
Research three topics simultaneously and get structured summaries back:Pattern: Code Review
Delegate a security review to a fresh-context subagent that approaches the code without preconceptions:context field — it must include everything the subagent needs:
Pattern: Compare Alternatives
Evaluate multiple approaches to the same problem in parallel, then pick the best:Pattern: Multi-File Refactoring
Split a large refactoring task across parallel subagents, each handling a different part of the codebase:Pattern: Gather Then Analyze
Useexecute_code for mechanical data gathering, then delegate the reasoning-heavy analysis:
execute_code handles the 10+ sequential tool calls cheaply, then a subagent does the single expensive reasoning task with a clean context.
Inherited Tool Access
Subagents inherit the parent’s enabled toolsets.delegate_task does not accept a model-facing toolsets parameter, so delegated work cannot grant itself capabilities that the parent does not have. Configure the parent’s tools before starting the conversation when a delegated task needs web, terminal, file, or other access. Mibyan still strips child-blocked tools such as clarify, memory, and send_message; children keep execute_code for programmatic tool calling.
Constraints
- Default 10 parallel tasks: batches default to 10 concurrent subagents (configurable via
delegation.max_concurrent_childrenin config.yaml, no hard ceiling, only a floor of 1) - Nested delegation is opt-in: leaf subagents (default) cannot call
delegate_task,clarify,memory, orexecute_code. Orchestrator subagents (role="orchestrator") retaindelegate_taskfor further delegation, but only whendelegation.max_spawn_depthis raised above the default of 1 (floor 1, no ceiling); the other three remain blocked. Disable globally viadelegation.orchestrator_enabled: false.
Tuning Concurrency and Depth
Example: running 30 parallel workers with nested subagents:
- Separate terminals — each subagent gets its own terminal session with separate working directory and state
- No conversation history — subagents see only the
goalandcontextthe parent agent passes when callingdelegate_task - Default 250 iterations — set
delegation.max_iterationslower inconfig.yamlfor fleets of simple tasks to save cost - Not durable — top-level delegation runs in the background and posts its result back later, but it remains tied to the owning session and Mibyan process. Session closure,
/stop,/new, or a process restart can cancel or strand in-progress work. Usecronjob_manageorterminal(background=True, notify_on_complete=True)for work that must survive those boundaries.
Tips
Be specific in goals. “Fix the bug” is too vague. “Fix the TypeError in api/handlers.py line 47 where process_request() receives None from parse_body()” gives the subagent enough to work with. Include file paths. Subagents don’t know your project structure. Always include absolute paths to relevant files, the project root, and the test command. Use delegation for context isolation. Sometimes you want a fresh perspective. Delegating forces you to articulate the problem clearly, and the subagent approaches it without the assumptions that built up in your conversation. Check results. Subagent summaries are just that — summaries. If a subagent says “fixed the bug and tests pass,” verify by running the tests yourself or reading the diff. Failures are surfaced. A subagent that dies (provider error, timeout, crash) is reported with a clean one-line notice —⚠️ Subagent failed — "your goal": <reason> — in the CLI delegation tree and as a chat notice on gateway platforms, even when tool progress is turned off. The parent agent also receives the full error in the tool result.
For the complete delegation reference — all parameters, ACP integration, and advanced configuration — see Subagent Delegation.

