Coordinating Multiple Models in Complex Software Development
How to split planning and execution across models in one coding session: when coordination beats static routing, how to hand back failure evidence, and how to measure cost against completion rate.
After AI coding became part of daily engineering, teams hit a structural tension. Complex refactors need strong repository understanding and design reasoning. Bulk file edits, tests, and builds are frequent, more mechanical work. If every session stays on a high-capability model, routine steps are expensive. If everything stays on a lightweight model, mistakes on dependencies, interface semantics, and regression risk show up as repeated wrong fixes and abandoned work after tests fail. Multi-model coordination is about allocating reasoning strength by task stage, not picking one model at the start of the session.
How this differs from single-model routing
Typical model routing happens at the request boundary: prompt length, task tags, or a simple classifier send the whole job to one model, which then plans, edits, and self-checks. Control does not move during execution. That is simple and predictable, and it fits small, well-bounded changes such as a single-file format tweak or adding a clearly specified unit test.
Coordination treats a coding session as a state machine. A planner explores the codebase, maps dependencies, resolves ambiguity, and writes an executable plan. An executor follows the plan: edits files, adds code, runs builds and tests. If the executor hits repeated failure or unexpected behavior, control returns to the planner, which revises the plan from failure evidence and hands work back. These switches happen inside one session. Developers do not swap models by hand or stitch transition prompts.
The difference is not how many model names you use. It is whether control moves with evidence. Routing is static dispatch; coordination is a closed loop. Without failure feedback and plan revision, multiple models are just two independent calls, not an architect-and-implementer pairing.
Splitting roles so they hold up
The planner should explore and decide, not dump patches in place of execution. Typical duties:
- Scope the change: which modules must change, which are only callers, which must stay untouched.
- Map dependencies: interface contracts, config, data migration, build targets, and test entry points.
- Write checkable steps: done means compile success, a test group green, or a behavior checklist.
- Handle ambiguity: turn fuzzy edge cases into hypotheses and record how they will be verified.
The executor should do high-frequency, low-branching work: edit to the plan, keep style consistent, run agreed commands, and compress failure logs into short evidence. It should not expand scope or retry the same spot without reporting. Lightweight does not mean unconstrained; clearer constraints reduce drift.
Review can be a third role or folded into the planner’s look-back. Review asks whether the plan was followed faithfully and whether new coupling appeared—not whether to rewrite the implementation. If review shares the executor’s context and has no independent checklist, self-confirmation bias is obvious.
An illustrative control flow (roles only, no product API):
state = PLANwhile not done and steps < limit:if state == PLAN:plan = planner.explore_and_plan(repo, requirement, evidence)state = EXECUTEelif state == EXECUTE:result = executor.apply(plan)if result.ok:state = REVIEWelif result.repeated_failure or result.unexpected:evidence.append(result.summary)state = PLANelse:state = EXECUTEelif state == REVIEW:verdict = planner.review(plan, diff, tests)done = verdict.acceptif not done:evidence.append(verdict.gaps)state = PLAN
When coordination is worth it—and when it is not
Work that usually benefits has at least one of: many modules, dependencies missing from the prompt, read-before-write, or test failures that may not live in the last edit. Examples: changing a public API and updating callers, adding a cross-layer business rule, splitting an oversized module without breaking the existing build.
Unsuitable cases are equally clear. Single-file work with a hard acceptance bar and little context should be routed to one model; coordination only adds rounds and state errors. If the requirement is undecidable (no tests, no examples, success is subjective), a coordinator will not turn uncertainty into correctness. If the repo is huge and retrieval and permissions are weak, “exploration” becomes guessing—fix search scope and read-only bounds first, instead of stacking more models.
Handoffs back to planning must carry evidence
The weakest handoff is “tests failed.” The planner needs reviewable evidence: failing command, assertion diffs, a stack summary, patches tried and why they were dropped, and whether the current diff left the original plan. Too much evidence crowds context; too little loops on the same error.
In practice, use a fixed packet: symptom, minimal reproduction, hypotheses already ruled out, suggested next check. Force a handoff after a threshold (for example, two ineffective edits on the same test target) so local patching does not exhaust context. When the planner revises, it should state which steps are void and which hypotheses were falsified so old and new instructions are not stacked.
Looking at cost and completion together
The economics come from using expensive reasoning only at branch points. Planning and review are few calls with long context; execution is many calls that can be shorter. Total tokens alone may not show savings, because exploration and summaries also consume context. More useful metrics: task completion rate, human takeovers, wasted edit rounds, and reasoning cost per completed task.
For organizations running many engineering teams, predictability often beats the cheapest single run. Cap planning rounds, execution rounds, and allowed handoffs. Over the limit, stop the loop and give evidence to a person. That avoids lightweight models spinning on hard problems and high-capability models stuck on formatting. Spend may or may not drop; that depends on the mix of work. What you can commit to is itemized metering—plan, execute, and review billed separately so thresholds can be tuned later.
Engineering extras, not just swapping models
Coordination is a control policy, not a quality guarantee. These items decide whether it belongs in the daily pipeline.
Context and permissions. Planning needs read-only browse and retrieval; execution needs bounded write paths. If permissions exceed the plan, a lightweight model more easily edits unrelated files. Retrieval should return paths and symbols, not paste the whole repo.
Executable plans. Slogans like “optimize the architecture” leave the executor free to invent. Each step should map to file- or symbol-level goals and an acceptance command. Commands come from the existing build and test system; the coordinator only invokes them and truncates logs—it does not invent new build standards.
Observability. Record at least current state, role, round index, handoff reason, and final diff stats. Failures should be attributable to a bad plan, executor drift, or an unstable test environment. Without that trail you cannot review coordination or tell it apart from ordinary chat-based edits.
Humans stay in the loop. Auto-switching cuts the friction of changing models, not review duty. Before merge, still inspect the diff, critical paths, and test coverage. Coordinators reduce “this got complex, abort” interruptions; they are not a path to trunk without checks.
Existing platforms remain the source of truth: hosting, CI, logs, monitoring. Results must land on repeatable checks: does the same commit build in a clean environment. “Looked green in the chat” is not delivery. Object storage can keep long logs; queues can split slow builds from the interactive session. Those are generic capabilities, not tied to one coordination scheme.
Design mistakes
Hiding coordination in prompt stitching without exposing state, so developers cannot tell planning from blind edits. Setting the handoff threshold too high after many files have already been changed the wrong way. Letting the planner emit large patches that the executor rewrites, so two diffs overwrite each other. Using a coordinator to hide missing tests; with weak failure signals the state machine oscillates. Dumping all roles’ context together so a lightweight executor reads a stale plan and becomes less stable.
A more robust pattern: short plans, short evidence, the repo as the source of diffs; each round honors only the last valid plan; acceptance commands from existing project scripts; stop and hand to a human at the limit.
How to tell if it is actually better
Before rollout, compare on the same historical tasks, not a demo repo. Control: one model for the whole ticket. Experiment: plan–execute–handoff. Compare completion rate, human-edited lines, new regression failures, and why sessions stopped. Stratify tasks: single-file, cross-module, vague requirements without tests. If only the cross-module subset with clear acceptance improves, make coordination optional, not the default.
In the evaluation window, look at the distribution of reasoning cost, not only the mean. Long-tail sessions (repeated handoffs) often dominate bills and wait time. If the tail is flaky tests, stabilize the environment first. If it is non-executable plans, fix the plan template instead of upsizing the model.
Takeaway
Multi-model coordination uses different reasoning strength in one coding session: the planner explores, disambiguates, and revises; the executor changes code to the plan and collects failure evidence; control returns when needed. That is not one-shot routing at the door. It can raise the chance of finishing complex work and keep expensive inference at real decision points—if plans are checkable, failures can be handed back, permissions and rounds are capped, and results reproduce in the existing build system. For developers, fewer mid-task abandonments. For engineering managers, spend can be observed by role instead of choosing only “strong model for everything” or “light model for everything.”
