delegate_batch
Dispatch up to 4 independent sub-tasks in parallel using a single call, benefiting from KV cache prefix reuse for faster prompt processing.
Instructions
Despacha hasta N agentes EN PARALELO en una sola llamada, usando asyncio.gather. Útil cuando el orquestador quiere ejecutar N sub-tareas independientes simultáneamente en backends que soportan paralelismo nativo (e.g., llama.cpp con --parallel 4).
USE WHEN you have multiple independent sub-tasks and your backend has parallel slots available (delegate cap = 4 = heavy-coding throughput sweet-spot; oMLX allows 8). With same agent_name reused across tasks, you also benefit from KV cache prefix reuse on the shared system prompt (~30-50% prompt-processing savings).
LIMITATION: Sub-agents launched via Claude Code's Agent/Task tool do NOT inherit parent's MCP servers, so this tool cannot be called from within a sub-agent. It only works from the main orchestrator session. Sub-agents that need parallelism should use httpx.AsyncClient + asyncio.gather directly against your LiteLLM endpoint.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tasks | Yes | List of task dicts. Each dict has the same keys as delegate_to_local_agent's parameters: {agent_name, task, workdir?, max_turns?, model?, max_tokens?}. agent_name and task are required; rest use defaults. Hard cap MAX_BATCH_SIZE (4) tasks per call. For more, split into multiple calls or use sequential delegate_to_local_agent calls. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||