CDX-301h · Module 1
The Lead/Worker Model
3 min read
The lead/worker model separates planning from execution. The lead agent — running a reasoning model like o3 — decomposes the task, assigns subtasks to workers, monitors progress, and aggregates results. Worker agents — running fast execution models like codex-1 or gpt-4.1 — implement their assigned subtasks without needing to understand the broader context. This separation mirrors how a tech lead coordinates a development team: the lead thinks strategically, the workers execute tactically.
The critical design decision is what the lead owns versus what the lead delegates. The lead owns decomposition (deciding what to do), sequencing (deciding the order), quality assessment (deciding if output is good enough), and conflict resolution (deciding how to merge). The lead does not write code, tests, or documentation — those are worker deliverables. A lead that both plans and implements will bottleneck on the most expensive model in the pipeline.
The lead's instructions should define its authority explicitly: can it retry workers? Can it reassign tasks between workers? Can it abort the pipeline? Can it modify the decomposition mid-pipeline? Ambiguous authority leads to unpredictable behavior — the lead either does too much (micromanaging workers) or too little (letting failures propagate). Define the authority boundary in the lead's system prompt.
Do This
- Use a reasoning model (o3) for the lead and execution models (codex-1, gpt-4.1) for workers
- Define the lead's authority explicitly in its system prompt — retry, reassign, abort permissions
- Keep the lead focused on coordination — it decomposes, delegates, and validates but never implements
- Start with 2-3 workers and scale up only after validating the coordination pattern
Avoid This
- Use the same expensive model for both lead and workers — the lead needs reasoning, workers need speed
- Let the lead write code "while waiting" for workers — it muddies the separation of concerns
- Give the lead unlimited authority without guardrails — it should not be able to bypass quality gates
- Skip defining the lead's authority — ambiguity leads to inconsistent pipeline behavior