← In the News

Agents write bigger patches, and most of the extra is tests

How Much Do Coding Agents Over-Edit, and Why? · Aakash Goel, Benjamin Steenhoek, Yu Hu, Microsoft · arXiv, November 25, 2026

Machine-readable Download Markdown

The authors' method, Delta Residue Attribution, replays an agent's trajectory, traces each block of the final patch to the step that wrote it, reverts the block, and reruns the task tests to see whether it was needed. They applied it to 7,660 resolved GitHub Copilot CLI trajectories from 18 frontier models, 6,728 on SWE-bench Verified and 932 on DeepSWE, and graded the developers' own patches the same way.

Agent patches do change more lines. On SWE-bench Verified the extra edits are mostly tests (61%) and documentation (13%); on DeepSWE, 58% of the extra edits are code. On code, agents are on average at least as necessary as developers: mean code necessity of 0.887 against 0.864 on SWE-bench Verified, and 0.797 against 0.785 on DeepSWE. Eleven of the 18 models leave less unneeded code than developers on SWE-bench Verified; the three Gemini Flash models leave more. Still, about 11% of an agent patch's code units on SWE-bench Verified are unneeded, and 89% of those change behavior, so a reviewer cannot wave them through.

The amount differs by model and does not follow resolve rate. Sonnet 5 resolves 80.6% of SWE-bench Verified and Gemini 3.7 Flash 81.4%, but Gemini 3.7 Flash leaves about 3.6 times as many unneeded code units per task (1.23 against 0.34). On DeepSWE the relation reverses: models that solve more tasks leave more unneeded code (Spearman -0.59).

The cleanup experiments are the practical part. Stopping at the agent's first all-green test run barely changes the patch (code necessity 0.700 to 0.710). Asking the model to justify each hunk of its own diff finds 35.5% of the unneeded units at 65.7% precision, and its drops break 1.8% of resolved patches. Pruning with the agent's own tests plus the repository's existing regression tests finds 67.3% at 46.3% precision, and 89.1% of pruned patches still resolve the task. That method applied to only 2,495 of 6,724 patches, because the rest lacked a usable standalone test command or failed the baseline check. The authors' recommendation: "We recommend reporting code necessity next to resolve rate and addressing over-editing through model training and harness-level pruning."

The paper lists its own limits. The main results use one harness, Copilot CLI. SWE-bench Verified is Python-only and "may be contaminated." Role labels were checked against a second LLM judge, with no human audit. We read the main results, discussion and limitations but not the appendices, and we did not find a code or data release linked from the paper.

Why it matters: A patch that passes the tests can still carry code nobody asked for, and resolve rate will not tell you which model leaves more of it for a reviewer. Both cleanup methods run after the agent finishes and fit in a harness. In these numbers, self-audit rarely breaks a patch but misses most of the excess, while test-based pruning finds more and sometimes drops needed code, mostly behavior that no test exercises.