|
| 1 | +--- |
| 2 | +summary: "Run parallel specialist agents without clogging shared model and tool capacity" |
| 3 | +title: "Parallel specialist lanes" |
| 4 | +sidebarTitle: "Specialist lanes" |
| 5 | +read_when: |
| 6 | + - You route group chats to dedicated agents |
| 7 | + - You want parallel work without one long task blocking every chat |
| 8 | + - You are designing a multi-agent operations setup |
| 9 | +status: active |
| 10 | +--- |
| 11 | + |
| 12 | +Parallel specialist lanes let one Gateway route different chats or rooms to |
| 13 | +different agents, while keeping the user experience fast. The trick is to treat |
| 14 | +parallelism as a scarce-resource design problem, not just as "more agents". |
| 15 | + |
| 16 | +## First principles |
| 17 | + |
| 18 | +A specialist lane only improves throughput when it reduces contention for the |
| 19 | +real bottlenecks: |
| 20 | + |
| 21 | +- **Session locks**: only one run should mutate a given session at a time. |
| 22 | +- **Global model capacity**: all visible chat runs still share provider limits. |
| 23 | +- **Tool capacity**: shell, browser, network, and repository work can be slower |
| 24 | + than the model turn itself. |
| 25 | +- **Context budget**: long transcripts make every future turn slower and less |
| 26 | + focused. |
| 27 | +- **Ownership ambiguity**: duplicate agents doing the same job waste capacity. |
| 28 | + |
| 29 | +OpenClaw already serializes runs per session and caps global parallelism through |
| 30 | +the [command queue](/concepts/queue). Specialist lanes add policy on top: |
| 31 | +which agent owns which work, what stays in chat, and what becomes background |
| 32 | +work. |
| 33 | + |
| 34 | +## Recommended rollout |
| 35 | + |
| 36 | +### Phase 1: lane contracts + background heavy work |
| 37 | + |
| 38 | +Give every lane a written contract in its workspace and system prompt: |
| 39 | + |
| 40 | +- **Purpose**: the work this lane owns. |
| 41 | +- **Non-goals**: work it should hand off instead of attempting. |
| 42 | +- **Chat budget**: quick answers stay in chat; long tasks should acknowledge |
| 43 | + briefly, then run in a background sub-agent or task. |
| 44 | +- **Handoff rule**: when another lane owns the work, say where it should go and |
| 45 | + provide a compact handoff summary. |
| 46 | +- **Tool-risk rule**: prefer the smallest tool surface that can do the job. |
| 47 | + |
| 48 | +This is the cheapest phase and fixes most clogging: one coding job no longer |
| 49 | +turns the research lane into molasses, and each chat keeps its own context clean. |
| 50 | + |
| 51 | +### Phase 2: priority and concurrency controls |
| 52 | + |
| 53 | +Tune queue and model capacity around the business value of each lane: |
| 54 | + |
| 55 | +```json5 |
| 56 | +{ |
| 57 | + agents: { |
| 58 | + defaults: { |
| 59 | + maxConcurrent: 4, |
| 60 | + subagents: { maxConcurrent: 8 }, |
| 61 | + }, |
| 62 | + }, |
| 63 | + messages: { |
| 64 | + queue: { |
| 65 | + mode: "collect", |
| 66 | + debounceMs: 1000, |
| 67 | + cap: 20, |
| 68 | + drop: "summarize", |
| 69 | + }, |
| 70 | + }, |
| 71 | +} |
| 72 | +``` |
| 73 | + |
| 74 | +Use direct/personal chats and production-ops agents for high-priority work. Let |
| 75 | +research, drafting, and batch coding move to background tasks when the system is |
| 76 | +busy. |
| 77 | + |
| 78 | +### Phase 3: coordinator / traffic controller |
| 79 | + |
| 80 | +Add a small coordinator pattern once multiple lanes are active: |
| 81 | + |
| 82 | +- Track active lane tasks and owners. |
| 83 | +- Detect duplicate requests across groups. |
| 84 | +- Route handoff summaries between lanes. |
| 85 | +- Surface only blockers, completed results, and decisions the human must make. |
| 86 | + |
| 87 | +Do not start here. A coordinator without lane contracts just coordinates chaos. |
| 88 | + |
| 89 | +## Minimal lane contract template |
| 90 | + |
| 91 | +```md |
| 92 | +# Lane contract |
| 93 | + |
| 94 | +## Owns |
| 95 | + |
| 96 | +- <job this lane is responsible for> |
| 97 | + |
| 98 | +## Does not own |
| 99 | + |
| 100 | +- <work to hand off> |
| 101 | + |
| 102 | +## Chat budget |
| 103 | + |
| 104 | +- Answer quick questions directly. |
| 105 | +- For multi-step, slow, or tool-heavy work: acknowledge briefly, spawn/background |
| 106 | + the work, then return the result when complete. |
| 107 | + |
| 108 | +## Handoff |
| 109 | + |
| 110 | +If another lane owns the request, reply with: |
| 111 | + |
| 112 | +- target lane |
| 113 | +- objective |
| 114 | +- relevant context |
| 115 | +- exact next action |
| 116 | + |
| 117 | +## Tool posture |
| 118 | + |
| 119 | +Use the smallest tool surface that can complete the task. Avoid broad shell or |
| 120 | +network work unless this lane explicitly owns it. |
| 121 | +``` |
| 122 | + |
| 123 | +## Related |
| 124 | + |
| 125 | +- [Multi-agent routing](/concepts/multi-agent) |
| 126 | +- [Command queue](/concepts/queue) |
| 127 | +- [Sub-agents](/tools/subagents) |
0 commit comments