Termination lag: coding agents solve early but stop late
The paper measures termination lag, the steps between a coding agent's first correct patch and the end of its run, across five models, two agent frameworks and three SWE-bench datasets. In 38-82% of successful runs the first source edit was already correct…
Why it matters
A large share of coding-agent token spend happens after the problem is solved, so better stopping criteria could cut cost without hurting accuracy.
What happened
1 min readThe paper measures termination lag, the steps between a coding agent's first correct patch and the end of its run, across five models, two agent frameworks and three SWE-bench datasets. In 38-82% of successful runs the first source edit was already correct, yet a median 35-60% of steps came after the solution. In 1-8% of cases the agent later undid its correct patch.
Our analysis
Recording and testing every intermediate patch gives a practical, repeatable way to measure waste. The models studied (Qwen3-Coder and Laguna-XS.2) are open models, so it's unclear whether commercial agents such as Claude Code or Codex behave the same way. Some post-solution steps are useful verification, so stopping early carries its own risk. For agent-framework builders, checkpointing patches and running tests mid-run is a cheap idea to try.