Termination Lag: Coding Agents Solve Early but Stop Late
Organizations: The Pennsylvania State University, University Park, PA, USA
Abstract
Coding agents can solve a task well before they stop working on it. We characterize termination lag--the number of steps between an agent's first correct patch and the end of its run--across five models, two agent frameworks, and three SWE-bench datasets by recording and testing every distinct repository patch generated during execution. Our analysis reveals that 38--82% of successful runs achieve a correct solution on their initial source-code edit. However, agents continue to expend substantial effort after correct patches, with post-solution steps accounting for a median of 35--37% for Qwen3-Coder and 54--60% for Laguna-XS.2 in successful runs on SWE-bench Verified and Multilingual. Agents spend most of these additional steps verifying their work and exploring the repository. In a small fraction of cases (1--8%), this continued activity leads agents to undo their earlier correct patch, leaving the final solution incorrect.
Figures & tables
| Qwen3-Coder | Laguna-XS.2 | |||
| Verif. | Multi. | Verif. | Multi. | |
| Solved (%) | 43.8 | 22.3 | 56.0 | 48.0 |
| TTFCP | 30 | 34 | 38 | 50 |
| Final step | 48 | 54 | 95 | 108 |
| TL | 16 | 18 | 57 | 56 |
| NTL (%) | 35 | 37 | 60 | 54 |
Appendix figures & tables9 assets
Supplementary material from the paper’s appendix.
Appendix
| OpenHands | mini-SWE-agent | |
| Solved | 43.8% | 32.4% |
| First correct step, median (solved runs) | 30 | 22 |
| Agent’s own stop, median (solved runs) | 48 | 37 |
| Steps after the fix, median / p90 | 16 / 22 | 12 / 23 |
| Share of the trajectory after the fix, median | 35% | 37% |
| Steps per task, median | 53 | 52 |
LLM Agents
Large language model agents use language models to plan, use tools, and act across multi-step tasks and environments.
See all 757 papers