arXiv:2610.11593cs.SEOct 2026

Manuscript Offprint

arXiv:2610.11593

Runnable Commit Untangling for Coding Agents

Jinfeng Jiang, Dongsun Kim, Dayi Lin, Zhou Yang

Jinfeng Jiang 1,4^{1,4}, Dongsun Kim 1,†^{1,\dagger}, Dayi Lin 2^{2}, Zhou Yang 3,4,5,†^{3,4,5,\dagger}

1^{1}Korea University, 2^{2}University of Waterloo, 3^{3}University of Alberta,

4^{4}Alberta Machine Intelligence Institute (Amii), 5^{5}Canada CIFAR AI Chair

†^{\dagger}Corresponding authors

Coding agents produce large, tangled patches that mix multiple development purposes, making the code hard to review and maintain. Commit untangling offers the promise of organizing such large patches into untangled, manageable commits. This paper emphasizes two important limitations in existing commit untangling studies. First, they do not consider that untangled commits are ordered and should leave the code runnable. In practice, maintainers are unlikely to accept commits that prevent the code from running. Second, existing studies claim that commit untangling helps software maintenance. However, they conduct syntactic comparisons between the untangled commits and developers' original commits without directly showing the claimed maintenance benefits. To address these gaps, this paper makes two novel contributions: ① RucTANGLE, the first agentic method that untangles commits while keeping the code runnable after each commit; and ② TANGLEEVAL, the first evaluation framework that quantifies how untangled, manageable commit histories help coding agents repair bugs. We compare RucTANGLE against four untangling methods on 131 agent-generated patches. All histories produced by RucTANGLE are runnable, while baselines produce 20.6%–37.4% unrunnable commit histories. We further collect 453 agent-generated patches that introduce regressions (i.e., causing previously passing tests to fail) and ask two other coding agents to repair regressions. Augmenting agent context with RucTANGLE-produced histories yields 5.2% absolute improvement in pass@1. We also analyze agent trajectories to learn how they use untangled commits to navigate and fix bugs. Our findings demonstrate the value of adopting established software engineering practices in the era of coding agents, which broaden the future research agenda: how can agents actively use software history to make better development decisions?

Date: October 8, 2026

Correspondence: darkrsw@korea.ac.kr; zy25@ualberta.ca

Figure

1 Introduction

"Change the programs in small steps, so if you make a mistake, it is easy to find where the bug is."

—Martin Fowler [8]

Coding agents are increasingly used in software development, but their output still requires review and maintenance [37]. Google reported that AI generated 75% of its new code in April 2026, with engineers reviewing and approving the output [28]. Agent-written patches are often tangled, containing changes that serve multiple development purposes, such as implementing a feature and refactoring existing code [36, 13]. These patches are also substantially larger: on SWE-bench Verified, agent-written patches are twice as large as human-written patches [24]. When different purposes are mixed in a large patch, reviewers must distinguish the intended behavior changes from edits that should preserve existing behavior. If the patch introduces a bug, developers must also identify which of these changes caused it. Organizing these changes so that they can be inspected separately is therefore important for reviewing and maintaining agent-generated code.

Commit untangling aims to organize a tangled patch into smaller commits, each containing changes that serve a single development purpose [30, 27, 19]. Prior work argues that separating changes by purpose makes

Jiang et al.

ami

them easier to understand and review [30, 19]. These studies also motivate untangling through its potential benefits for software maintenance. For example, separating unrelated changes can help developers narrow down which changes introduced a bug [27]. It can also let developers revert an unwanted feature without discarding an unrelated bug fix included in the same patch [30, 42]. However, this paper emphasizes two key limitations in how existing studies construct and evaluate untangled commits:

Limitation 1: Ignoring Runnability. Existing untangling methods [30, 27, 42] do not check a practical and fundamental requirement for commit histories: the code should remain runnable after each commit. Applying a sequence of commits to a repository produces a project version after each step. We refer to the versions between the initial and final versions as intermediate versions. In modern development, code review and continuous integration (CI) checks are performed before changes are accepted [9]. A commit that prevents the software from running is likely to be rejected. For example, the Linux kernel guidelines [23] explicitly require the kernel to build and run properly after every patch in a series, so that developers can inspect the history to locate bugs. Thus, we emphasize that runnability is a prerequisite of untangled histories. Yet existing studies [30, 27, 42] do not enforce this requirement in method design and evaluation, limiting practical use.

Limitation 2: Unvalidated Maintenance Benefits. Existing studies claim that commit untangling helps developers review changes and locate bugs, but their automated evaluations do not directly test these practical benefits [27, 19, 42]. A widely used evaluation setting combines several developer-written commits from repository history into a single, synthetic tangled patch [27, 19]. Researchers then ask an untangling method to split this patch and measure how accurately it recovers the original commits. A higher score therefore indicates closer agreement with the developers' original grouping decisions. Atomizer's additional evaluation on expert-annotated real commits also measures agreement with the reference commits [42]. However, existing evaluation does not establish the practical benefits of generated commits, especially in the era of AI coding.

These practical limitations motivate us to make two novel contributions: ① RUCTANGLE, the first agentic method that untangles patches while keeping the code runnable; and ② TANGLEEVAL, the first evaluation framework that quantifies how untangled commits help coding agents.

RUCTANGLE (Runnable Commit UnTangle) is an agentic commit untangling method. Given a tangled patch and the initial project version, an agent groups the changes by development purpose and proposes an ordered sequence of commits. RUCTANGLE applies these commits one by one and checks whether the code remains runnable. When a check fails, it first uses the error message to adjust the commit order. If failures persist, it asks the agent to revise the grouping and order. If these revisions still fail, it merges adjacent commits to remove versions that cannot run. It repeats the checks after each adjustment while preserving the final code produced by the original patch. We compare RUCTANGLE with four baselines on 131 patches produced by a Claude Opus 4.6 agent across 100 Python repositories in SWE-CI [5]. RUCTANGLE produces a history for every patch, with the code after every commit passing the runnability checks. By comparison, 20.6%–37.4% of the histories returned by the baselines contain at least one version that fails runnability checks.

TANGLEEVAL lets coding agents repair regressions in tangled, agent-generated patches. We collect 453 patches generated by six agents from SWE-CI [5], each causing previously passing tests to fail. We ask two other coding agents, powered by Qwen3-Coder-Next and Nemotron-3.5-Lightning-30B-A3B (using mini-swe-agent [33] as the harness), to repair these regressions. For each patch, the repair agents start from the same failing code. We compare repair without untangled commits against repair with histories generated by RUCTANGLE, Armchr [1], or Atomizer [42]. Because RUCTANGLE keeps the code runnable after each commit, we can run the failing tests with git bisect to identify a candidate commit that introduced the regression. We add this result to the repair agent's context. Compared with repair without untangled commits, RUCTANGLE raises pass@1 from 26.9% to 31.3% for Qwen and from 30.8% to 36.0% for Nemotron. The average relative improvement across the two models is 16.6%. Armchr and Atomizer also improve repair performance, but yield smaller average relative gains of 4.5% and 6.1%, respectively.

To better understand how untangled commits help coding agents repair bugs, we conduct case studies comparing agent trajectories with and without these commits. We find that agents use commit diffs and messages to identify behavior that a repair should preserve. However, in one attempt, we also observe agents repeatedly reconsidering a correct repair when it conflicts with a misleading commit message.

Runnable Commit Untangling for Coding Agents

ami

To summarize, we make the following contributions:

• Research Gap (Section 2): We identify two practical limitations of existing commit untangling research: existing commit untangling methods do not check whether the code remains runnable after each commit, and current evaluations neither consider real-world development constraints nor demonstrate the practical benefits of untangling for subsequent software development.

• Approach (Section 3): We propose RucTANGLE, the first commit untangling method that produces runnable commits by checking runnability after each commit and uses execution feedback to revise the results.

• Evaluation (Sections 4 and 5): We propose TANGLEVAL, the first evaluation framework that measures how untangled commit history helps coding agents repair bugs.

• Implication (Section 6): We provide the first empirical evidence that untangled histories can improve coding agents' bug-fixing performance. This finding motivates using rich histories in software development.

References (32)