Agent Role Separation for Complex Software Development: Assigning Planning, Scheduling, and Execution to the Right Models
When teams use AI coding agents, failures usually stem from role mismatch, not model capability. This article explains how to split agent work into three responsibilities—planning, scheduling and acceptance, and execution—and how to select models for each using four dimensions: context cost, instruction adherence, tool capability, and escalation cost. It also covers a practical collaboration workflow, a task package template, why "unlimited cheap retries" often cost more, common failure patterns and fixes, and minimal disciplines for rolling out role separation on a real engineering platform.
The Problem Is Role Mismatch, Not Model Tier
After teams adopt AI coding tools, a common approach is to hand planning, task decomposition, coding, self-testing, and acceptance to a single long conversation. The longer the conversation, the heavier the history, and the more likely the model drifts from initial constraints in the later stages: interface naming drifts, tests get skipped, edge cases get “optimized” away. Another common approach uses a high-reasoning tier to repeatedly read through the repository and history, then hands the actual writing to a lower-adherence execution tier. The first wastes money on redundant reading; the second loses money to rework. Both bind “thinking clearly” and “doing correctly” to the wrong positions.
A better starting point is to accept that capabilities don’t align along a single axis. Some models excel at decomposing goals, discovering dependencies, and writing acceptance criteria, but are ill-suited to file-by-file code changes in very long contexts. Others follow instructions reliably and make stable tool calls, but shouldn’t make architectural judgments from scratch. A third category works best as an intermediate dispatcher: splitting tasks into smaller pieces, verifying definitions of done, and deciding when to escalate to a human or a higher tier. The goal of role separation is to fix mismatches, not to chase a single “all-capable tier.”
Define Three Responsibilities First, Then Select Models
Planning answers “what to do, what not to do, and what counts as done.” Its inputs should be requirements, constraints, relevant module boundaries, and risks—not the entire repository. Its output should be executable task packages: goals, scope, non-goals, interface contracts, data and error semantics, test essentials, and rollback or compatibility requirements. Planning may involve multiple rounds of clarification, but each round should reduce uncertainty, not pile up alternative designs.
Scheduling and acceptance answer “which task runs now, is it done, and where does it fall short.” The scheduler doesn’t rewrite implementations; it only maintains task status, dependency ordering, and definitions of done. Acceptance checks whether the diff stays in scope, whether tests cover the agreed behavior, and whether undeclared public interface changes were introduced. The scheduler can read execution results and failure logs, but should not pipe the entire history back to the planner verbatim.
Execution answers “how to modify the code under a given contract and pass the checks.” The executor should receive short tasks, necessary file fragments, interface contracts, and acceptance commands—not the full conversation history. The point of executing with no or short history is to force the task itself to be self-contained: if work is impossible without prior context, the task package isn’t written clearly enough and should go back to scheduling or planning—rather than gambling on a longer context.
Four Dimensions for Qualitative Model Selection
Context cost. The cost of reading the repository, specs, and history roughly scales with input length. Having an expensive tier re-read the full repository every round usually yields less value than having it judge only at points of disagreement. If the execution tier must repeatedly ingest irrelevant history, its attention to the current diff gets diluted too.
Instruction adherence and local quality. Execution failures typically aren’t “can’t write code at all,” but contract deviations: touching extra files, weakening validation, hiding errors behind temporary branches, testing only the happy path. Fixing this after the fact by having a higher tier read the whole conversation tends to feed the low-quality diff and verbose logs back into context, creating a token feedback loop. A better approach is to hard-code into the task package the allowed modification paths, the behaviors that must be preserved, and the checks that must pass.
Tool and perception capability. For tasks involving UI operations, screenshot interpretation, or switching between logs and terminals, the execution tier needs stable tool calling and visual understanding—not just text completion. If the execution model frequently misclicks or misreads UI state in these scenarios, escalate that task to a tier with more reliable tooling rather than expanding the text-based plan. Pure algorithms and in-library refactoring depend more on local edit quality and test discipline.
Escalation cost. The middle layer can be “dumb,” as long as it faithfully relays contracts, blocks out-of-scope changes, and provides reproducible steps on failure. Correct execution by subordinates matters more than the middle layer’s eloquence. Only when a failure involves requirement ambiguity, cross-module invariants, or security boundaries should compressed evidence go to the planning tier—never the repository and full conversation history dumped back wholesale.
An Operational Collaboration Pipeline
Planning produces task packages only. Each package should be sized so a single execution run can complete it: one behavior change, a related set of tests, explicit non-goals. For large cross-module changes, split dependencies first, then mark the parallelizable leaf tasks.
Scheduling maintains the queue and gates. Use only a few states: pending, in progress, awaiting acceptance, returned, done. Every return must attach failure evidence: the command, key errors, and a summary of contract-violating diffs—not the model’s own narrative.
Execution defaults to short context. Inputs are the task package, relevant file paths or fragments, and acceptance commands. Executors must not expand scope on their own; if the contract is insufficient, they return “insufficient information” rather than making speculative large changes.
Acceptance judges diffs, not writing style. Pass criteria: the diff stays within allowed paths, behavior matches the contract, agreed checks pass, and no undeclared interface or data semantics changes. Prose fluency is not a pass criterion.
Compress before escalating. When a higher tier must review, submit only the goal, contract, diff summary, failing checks, and points of contention. Review conclusions should be written back as a new task package or acceptance patch and re-enter short-context execution, so the review conversation itself doesn’t become new long history.
An illustrative task package doesn’t need to bind to any specific product—just keep the fields stable:
Goal: Add an explicit error for insufficient inventory when creating ordersNon-goals: Do not change price calculation; do not alter table schemasAllowed paths: order service and corresponding testsContract: Insufficient inventory returns a stable error code; no order is writtenAcceptance: Agreed unit checks pass; add one insufficient and one sufficient test caseFailure report: Command, assertion diff, list of actually modified files
Why “Unlimited Execution” Often Costs More
On the surface, a weak execution tier is cheap per call, so you can retry many times. The real cost comes from three amplifications: wrong implementations get written into subsequent context, reviewers must re-read the repository and history, and repeated rewrites before passing destroy what was originally correct planning. When planning is right but execution goes wrong, the root causes are usually tasks that are too large, acceptance criteria that aren’t machine-readable, or the executor seeing too much conversation history irrelevant to the current change.
Placing the middle layer on scheduling and acceptance—letting the expensive tier read less and judge more, and letting the execution tier think less about the big picture and hold to contracts more—usually costs less overall than either extreme: a high tier re-reading the full repository end to end, or a low tier rewriting continuously with no acceptance. The extra overhead is mainly task packages and gates, not full-repository re-reads. When UI operations or image judgment are needed, handing those steps to an execution tier with sufficient tooling capability is more effective than repeatedly describing the interface in text-based planning.
Common Failures and Corrections
Planning is too fine-grained, down to line numbers and temporary implementations, so execution loses reasonable freedom and the whole package fails on any code drift. Planning should constrain behavior and boundaries, not do line-by-line design in place of execution.
Scheduling only forwards and sets no definition of done, so the middle layer becomes noise. Every task needs at least a pass condition that can be reproduced stably, automatically or manually.
Execution expands its search when blocked, reading in unrelated modules, which both increases cost and introduces irrelevant diffs. Insufficient information should go back, with scheduling supplying fragments or escalating to planning.
Review becomes a second implementation. Review should only adjudicate disputes and rewrite the contract; the actual patch still goes through short-context execution, preventing two coexisting implementations.
No one owns compatibility and rollback. If a task package touches externally visible behavior, it must state whether existing callers are affected and how to back out the diff on failure.
Minimum Disciplines for Rollout
Start by piloting role separation on real, small tasks, recording round-trip counts per responsibility, return reasons, and whether final diffs stayed in scope—rather than evaluating tiers by subjective feel. Machine-readable acceptance criteria should be written as check commands or assertions first, reducing models describing things to each other. Parallel leaf tasks must declare shared files to avoid two execution paths overwriting the same contract. Security-related changes, permissions, data deletion, and migration tasks should default to a higher acceptance tier—don’t skip it just because execution looks smooth.
If your team already has a unified engineering platform, simply map these roles onto switchable model tiers and isolated sessions, rather than tying the workflow to the interaction habits of any single conversational product. Object storage can hold task packages and diff summaries; logs and monitoring preserve acceptance command results; containerized or staging environments reproduce failures. These are all generic engineering capabilities that support handoffs—they don’t replace the contract itself.
The conclusion is plain: let the planning tier make fewer, more precise decisions; let the middle layer schedule and accept against definitions of done; let the execution tier change code against contracts in short context. The middle layer doesn’t need the best writing—it needs to not lose scope, evidence, and gates. The goal isn’t more rounds; it’s fewer opportunities for wrong implementations to enter the next round of context, making quality, tool-heavy scenarios, and total consumption controllable at the same time.
