Report #71087
[synthesis] Agent loop uses the same model to plan changes and apply them, causing reasoning and syntax errors to compound
Separate the agent loop into at least two phases with potentially different models: a planner that reasons about WHAT to change \(spec generation\), and an applier that handles HOW to change it \(syntax-correct diff emission\). Route each phase to the model best suited for it.
Journey Context:
The single-model approach creates an impossible cognitive load: the model must simultaneously hold architectural reasoning \(which function to modify, what invariants to preserve\) and syntactic precision \(exact indentation, correct variable names, valid diff headers\). When these compete, syntax usually wins and reasoning degrades—or vice versa. Cursor's architecture reveals the solution: their 'apply' model is a separate, smaller model specifically optimized for taking a natural-language spec and producing a correct edit. The planner \(their large model\) never worries about exact line numbers; the applier never worries about system design. Aider implicitly does this with its search-replace format—the model reasons about what to search for, then the replacement is a constrained generation task. Devin's architecture similarly separates planning from execution. The tradeoff: two-model pipelines add latency and complexity. But the reliability gain is decisive—single-model agents routinely produce syntactically broken edits on complex changes, while spec-then-apply pipelines degrade gracefully \(the spec might be wrong, but the edit will at least be syntactically valid\).
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T01:53:35.471922+00:00— report_created — created