# Termination Lag: Coding Agents Solve Early but Stop Late

Coding agents keep acting for many steps after a correct patch appears

Musa Cim, Burak Topcu, Mahmut Taylan Kandemir · arXiv · 2026-11-11

- **Problem** Benchmarks score only the final patch, so they hide when an agent first found a correct fix and how much work followed. Coding agents often keep spending many steps after that point.
- **Method** The authors save the repository patch after every agent step through a logging proxy, then test each distinct patch offline. This shows the first correct patch and the steps that come after it.
- **Results** Across SWE-bench settings, 38% to 82% of successful runs had a correct patch at their first edit. Solved Qwen3-Coder runs on Verified had a median termination lag of 16 steps.

## Final scores hide the solve point

Benchmark scoring only looks at the final submitted patch, so the primary metric for these agents is its correctness. A run that solves early and a run that solves late receive identical credit under that metric. For example, one agent submits right after applying a correct edit at step 10, while another spends 40 additional steps rerunning tests and reviewing its diff.

The late agent isn't any less capable, yet the final score can't tell the two runs apart.

Each extra step adds another model call over a longer context, which costs tokens, latency and compute. Every step also carries the risk of breaking code that already works. A correct patch can appear midway through a run and later be overwritten, so a failed final score can hide a solved task. Kim et al. (2026) document this overwriting, which the final-patch score alone would miss.

Some verification is still needed, because the agent never sees the benchmark tests. The authors therefore split the question into two parts: when a correct patch first exists, and what the later steps do to it. To study both parts, they track each run from its first source-code edit through to final termination. They name the steps until the first passing patch time to first correct patch (TTFCP), and the steps after it termination lag (TL).

## Recording and testing every step's patch

The core idea is to save the repository patch after every agent step and test each distinct one offline. The agent never sees these benchmark tests, so the grading can't steer its next move. A logging proxy sits between the agent and the model endpoint and records the patch before it forwards the next model request. The proxy captures the patch while the agent is waiting for a response, so the recording happens inside the step loop without pausing it.

Each recorded patch holds the difference between the current repository state and the task's base commit. The authors build each patch with a temporary Git index, which leaves the agent's working repository unchanged. After the run, the recorded patches are evaluated in isolated containers using the benchmark's official evaluation procedure.

Identical patches are evaluated only once, which keeps the offline testing cost down across many steps.

Let S be the step where the agent stops on its own, and F the earliest step whose patch passes the official evaluation. Time to first correct patch is defined as TTFCP = F, measured in agent steps. Normalized termination lag is NTL = (S − F)/S, the fraction of the run that comes after the first correct patch. Because NTL is a fraction, runs of different lengths can be compared on one scale.

## Models, frameworks and step budgets

OpenHands serves as the main agent framework for all five models in the study. Its tools let the agent read repository files, edit code, and run commands and tests. To check whether the findings carry over, the authors also run Qwen3-Coder on SWE-bench Verified with mini-SWE-agent. Qwen3-Coder-30B-A3B, Laguna-XS.2 and Seed-OSS-36B run on vLLM on the Aurora system.

Claude Haiku 5.5 and GPT-6 Luna are reached through the Anthropic and OpenAI APIs instead.

Qwen3-Coder and Laguna-XS.2 form the core settings, covering the complete SWE-bench Verified and Multilingual benchmarks. The authors run Claude Haiku 5.5 and GPT-6 Luna only on SWE-bench Verified, with OpenHands. Each run ends when the agent submits its patch, under a budget of 100 steps.

SWE-bench Verified provides 500 tasks drawn from Python repositories. SWE-bench Multilingual extends the evaluation to 300 tasks across nine programming languages. SWE-bench Pro asks for harder tasks that need more sustained agent execution. Qwen3-Coder has a 100-step budget and a context window of 131K tokens. Laguna-XS.2 has a 250-step budget and a context window of 256K tokens.

Seed-OSS-36B on SWE-bench Pro gets a 150-step budget and a 131K-token window.

The three benchmarks test whether the findings reach other programming languages and longer-horizon tasks. The grading runs in isolated containers, so the agent never sees the tests or their results.

## How long runs keep going after a fix

Solved runs keep going well after their first correct patch, and the paper measures this gap with termination lag. For Qwen3-Coder on SWE-bench Verified, the median termination lag is 16 steps, and the median normalized termination lag is 35%. Laguna-XS.2 on the same benchmark runs longer, with a median of 57 steps and a normalized lag of 60%.

Normalized termination lag is the fraction of the run's steps that fall after the first correct patch.

![Figure 1: First correct patch and agent stop by step, Qwen3-Coder-30B, SWE-bench Verified](https://refivu.com/papers/520a3a4d-fc06-4832-b3c1-a97eb683de41/figures/figure-35772c259d7e9238bc4070a8701bd38d.png?thumb=512)

**Figure 1** : First correct patch and agent stop by step, Qwen3-Coder-30B, SWE-bench Verified.

[Original paper](https://arxiv.org/abs/2611.14960v1) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Musa Cim, Burak Topcu, Mahmut Taylan Kandemir · Termination Lag: Coding Agents Solve Early but Stop Late · Original paper figure · Extracted the figure area from page 4 of the original PDF.

The gap also appears on SWE-bench Multilingual, where Qwen3-Coder shows 18 steps and 37%, compared with 56 steps and 54% for Laguna-XS.2. For Claude Haiku 5.5 on Verified, the first correct patch comes at step 9, and the median lag is 10 steps, or 54% of the run. GPT-6 Luna shows a median of 6 steps and 36%, and Seed-OSS-36B on SWE-bench Pro follows the same pattern.

Under mini-SWE-agent, Qwen3-Coder on Verified shows a median of 12 steps and 37%, so the pattern holds with a second framework.

To bound what stopping could save, the authors use an oracle that halts each run at its first correct patch. That oracle would remove a median of 35% and 37% of solved Qwen3-Coder steps on Verified and Multilingual. For Laguna-XS.2, the same oracle would remove 60% and 54% of solved steps, while Haiku loses 54% on Verified. The oracle keeps every originally solved task, but a real agent can't know when its patch is correct.

So the figure is a reference point for stopping rules rather than a rule an agent can run.

## Whether the first edit already fixes the task

The first patch is the one recorded right after the first source-code edit, so it is the earliest candidate for a fix. For Qwen3-Coder on Verified, 82% of runs that reach a correct patch already have it at the first edit. On Multilingual, the same share for Qwen3-Coder falls to 66%.

Laguna-XS.2 reaches 70% on Verified and 48% on Multilingual. GPT-6 Luna reaches 80% on Verified, while Seed-OSS-36B reaches 38% on Pro. Across all settings, this first-edit share runs from 38% to 82%. Each share is measured only over runs that reach a correct patch.

Agents need 1.3 to 3.6 distinct patches on average before they reach a correct one, counting that correct patch itself. Table 2 gives the mean for each model and benchmark, from 1.3 on Qwen3-Coder Verified to 3.6 on Seed-OSS Pro. For Qwen3-Coder on Verified, the median first-patch and first-correct-patch steps both fall at step 30. On Multilingual, the same two medians for Qwen3-Coder both sit at 34.

For Laguna-XS.2, the medians are 36 and 38 on Verified, and 45 and 51 on Multilingual. Seed-OSS-36B records medians of 17 and 26 on Pro, so its first correct patch arrives after its first edit. Many trajectories reach correctness on their first edit, but a substantial share of runs still needs further revisions.

## What the agent does after the fix

After the first correct patch, each recorded step is labeled by its tool use and arguments, into verification, exploration, source-code editing, wrap-up, or other. Verification is the largest category in every evaluated setting, taking 48 to 63% of the steps after the first correct patch. Qwen3-Coder on Verified puts 63% of its post-fix steps into verification, which is the highest share in its column of Table 3.

Exploration takes another 15 to 29% of those steps, as agents inspect files, search code and review repository changes.

Wrap-up covers removing temporary files and submitting the final response, while reasoning and other activities cover the rest. Further source-code edits are rare, at 2 to 6% in most settings. Seed-OSS-36B on SWE-bench Pro is the exception, with 19% of its post-fix steps spent on editing source code. The authors read this as agents spending their continued execution on checking work after a benchmark-correct patch already exists.

The authors separately track the patch in every run that reaches a correct patch, including runs that end unsolved. Stays correct to the end holds for 96% of Qwen3-Coder runs on Verified, while 3% break and become correct again. Across settings, 61 to 96% of such runs keep the correct patch through the remaining execution. Laguna-XS.2 on Verified repairs a broken patch in 11% of runs, and on Multilingual in 31% of runs.

Breaks and ends unsolved accounts for 1 to 8% of runs, so later work can cost a solution that was already correct.

## Whether the extra work helps the fix

Most runs keep their correct patch through the end, at rates from 61 to 96% across the settings. Qwen3-Coder on Verified keeps the patch correct in 96% of runs, which is the highest share reported. Laguna-XS.2 on Multilingual is the lowest at 61%, so its later edits break the fix more often. In Laguna-XS.2 on Multilingual, 31% of runs broke the fix and then repaired it before termination.

On Verified, 11% of Laguna-XS.2 runs did the same, and 17% of Seed-OSS runs on Pro did as well. The authors separate three outcomes: the patch stays correct, it breaks and is repaired, or it breaks and the run ends unsolved.

The authors track the patch in every trajectory that reaches a correct patch, including runs that end unsuccessfully. Across the settings, 1 to 8% of runs that reach a correct patch end with an incorrect patch. In these runs, stopping at the first correct patch would have kept the benchmark success. Stopping on the first correct patch would have avoided the regressions that later edits caused.

The authors argue that once a patch passes the benchmark tests, more work cannot raise its benchmark correctness. Further work can instead introduce regressions, so continued execution carries a risk to a solution that is already correct. The paper doesn't test whether a stopping rule could tell apart the runs that would break from the runs that would stay correct.

The conclusion frames this as a cost that comes with the extra steps, not only as a wasted effort.

## Limits of the evidence

The evidence covers three benchmarks, five models and two agent frameworks, so it may not carry over to other settings. Each task was run once, so the authors didn't measure how much a second run might change the step counts. Claude Haiku 5.5 and GPT-6 Luna were evaluated only on SWE-bench Verified, using OpenHands with a budget of 100 steps.

The mini-SWE-agent check covers only Qwen3-Coder on SWE-bench Verified.

Execution is measured in steps, which approximates cost but doesn't directly measure computational cost. Runs that reach the step or context limit are counted at their final step, and they make up 1 to 4% of runs per setting.

The step categories come from rules applied to the recorded tools and their arguments. The 19% source-edit share for Seed-OSS on Pro therefore comes from that small sample.

Qwen3-Coder and Laguna-XS.2 ran with budgets of 100 and 250 steps on the core benchmarks. Termination lag gives a reference point for such rules, but the paper doesn't test how much a live rule would save.

## Paper info

- **Authors**: Musa Cim, Burak Topcu, Mahmut Taylan Kandemir
- **Venue**: arXiv · Preprint
- **First published**: 2026-11-11
- **Added**: 2026-11-13
- **Updated**: 2026-11-11
- **Version**: v1
- **arXiv**: 2611.14960
- **Category**: cs.AI · cs.CL
- **Original paper terms**: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)
- **What we show**: Paper info, commentary and permitted figures from the original paper

[Original paper ↗](https://arxiv.org/abs/2611.14960v1) · [PDF ↗](https://arxiv.org/pdf/2611.14960v1)

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

## Abstract

Coding agents can solve a task well before they stop working on it. We characterize \\emph{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.

## Quote from the paper

Musa Cim, Burak Topcu, Mahmut Taylan Kandemir (2026). Termination Lag: Coding Agents Solve Early but Stop Late. arXiv:2611.14960v1. https://arxiv.org/abs/2611.14960v1

**BibTeX**

```
@misc{cim2026termination,
  title = {{Termination Lag: Coding Agents Solve Early but Stop Late}},
  author = {Musa Cim and Burak Topcu and Mahmut Taylan Kandemir},
  year = {2026},
  eprint = {2611.14960},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.14960v1}
}
```

## Other paper commentary

- [Cleaning an Agent's History Hurts When the World Still Holds the Error](https://refivu.com/en/papers/9f9d54ba-fe02-462d-babe-c0f8a725ef58-cleaning-an-agent-s-history-hurts-when-the.md)
- [MetaGPT: Meta Programming for A Multi-Agent Collaborative Framework](https://refivu.com/en/papers/91dd7973-493a-4820-91e2-46a50eb0a70e-metagpt-meta-programming-for-a-multi-agent-collaborative.md)
- [The Surprising Effectiveness of PPO in Cooperative, Multi-Agent Games](https://refivu.com/en/papers/7c9c355e-16b7-49a8-b767-07760b1c48a4-the-surprising-effectiveness-of-ppo-in-cooperative-multi.md)
- [AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation](https://refivu.com/en/papers/d3d2ade6-3bed-4a94-9439-088b61554b00-autogen-enabling-next-gen-llm-applications-via-multi.md)
- [Don't Just Trust Your Memory: Evidence-Linked Memory Reduces Memory-Induced Degradation in LLM Agents](https://refivu.com/en/papers/891cb954-271d-4055-bf45-e2d6d155e372-don-t-just-trust-your-memory-evidence-linked.md)
- [Code-Grounded Agentic Explanations for Static Analysis Vulnerability Findings](https://refivu.com/en/papers/e9fa7593-41df-421f-8615-e0870316904f-code-grounded-agentic-explanations-for-static-analysis.md)
- [Do Large Language Models Show Racial and Sex Bias in Pain Management? A Counterfactual Audit of GPT, Claude, Gemini, Llama, DeepSeek and Qwen](https://refivu.com/en/papers/35f582d1-90ca-40c6-a272-2cfa4575fafe-do-large-language-models-show-racial-and-sex.md)
- [Stress-Testing Sandbagging Detection Under Adaptive Attack](https://refivu.com/en/papers/d5f9221a-801e-4cf1-834b-f0b16f71c771-stress-testing-sandbagging-detection-under-adaptive-attack.md)
- [What Do Tokenizer Comparisons Measure? Disentangling Granularity, Root Assignment, and Word-Level Readout across Amharic and Hausa](https://refivu.com/en/papers/85edc7f0-4645-4f8c-95e9-bc84c1f4c53f-what-do-tokenizer-comparisons-measure-disentangling.md)
- [Verifier Choice is a Benchmark Design Variable: Auditing Structural Counting Evaluation in Text-to-Image Models](https://refivu.com/en/papers/68bb5c78-70c3-47d1-a5cc-da7cce40953a-verifier-choice-is-a-benchmark-design-variable-auditing.md)
- [Leaderboard Hacking: Preference-Based Model Evaluations are Vulnerable to Manipulation](https://refivu.com/en/papers/80654f3a-34dc-4e4a-a333-a94a0badbbec-leaderboard-hacking-preference-based-model-evaluations-are.md)
- [Abstention Is Not Threshold Compliance: Stated Scoring Rules in Open Language Models](https://refivu.com/en/papers/3fb56329-b972-47e1-93dd-325c7dec2433-abstention-is-not-threshold-compliance-stated-scoring-rules.md)

## Terms in this paper

- [GPT-6 Luna](https://refivu.com/en/terms/99c0d8f08298-gpt-6-luna)
- [Claude Haiku 5.5](https://refivu.com/en/terms/5ffaf6c86a42-claude-haiku-5-5)
- [ORACLE](https://refivu.com/en/terms/3ff0e5f5c4ee-oracle)
- [OpenHands](https://refivu.com/en/terms/0368eb006bfb-openhands)
- [SWE-bench Verified](https://refivu.com/en/terms/54503683119b-swe-bench-verified)
- [mini-swe-agent](https://refivu.com/en/terms/d0e50abf6838-mini-swe-agent)

---

AI-written text can contain mistakes. [Refivu](https://refivu.com/en/papers/520a3a4d-fc06-4832-b3c1-a97eb683de41-termination-lag-coding-agents-solve-early-but-stop)
