"Refactoring Runaway": Understanding and Mitigating Tangled Refactorings in Coding Agents for Issue Resolution
On the map: LLM agents and tool use → Software engineering coding agents
Abstract (arXiv)
Recent advances in coding agents have shown remarkable progress in software issue resolution. In practice, real-world issues are typically bug fixes or feature requests in which human developers naturally incorporate refactoring as part of the resolution process, resulting in tangled refactoring. Since LLMs are trained on large-scale open-source repositories, coding agents may inherit such behaviors. In this paper, we conduct an empirical study on Multi-SWE-bench, analyzing 3,691 valid patches generated by three agent frameworks with 12 LLMs. We find that coding agents introduce tangled refactorings less frequently (21.43% vs. 36.72%) and with lower intensity (0.66 vs. 1.75) than human developers, although they exhibit a broader diversity of refactoring types. Logistic regression analysis further shows that tangled refactorings are strongly associated with reduced compilability, while exhibiting no significant association with functional correctness. Based on these findings, we propose a refactoring-aware refinement approach that assesses the necessity and safety of tangled refactorings and selectively removes or repairs problematic operations. Our approach improves compilability from 19.34% to 38.33%, and additionally resolves 2.79% previously unresolved issues. Overall, this work presents the first step towards understanding tangled refactoring practices in agentic issue resolution and opens up avenues for future work.
Key facts. Cited by 1 paper in the map (data through 14 Oct 2026). Placed in Software engineering coding agents, one of 16 directions in LLM agents and tool use. Builds on 19 of its 55 references that are in the map. First posted on arXiv 21 May 2026.
Builds on
19 of 55 references.
Closest ancestors · 9
Same direction, newest first
- 2025Agentic Refactoring: An Empirical Study of AI Coding Agents6 Nov
- 2025REFINE: Enhancing Program Repair Agents through Context-Aware Patch Refinement4 Oct
- 2025Trae Agent: An LLM-based Agent for Software Engineering with Test-time Scaling31 Jul
- 2025Understanding Automated Program Repair Agents Through the Lens of Traceability: An Empirical Study10 Jun
- 2025SWE-smith: Scaling Data for Software Engineering Agents30 Apr
- 2025Beyond Final Code: A Process-Oriented Error Analysis of Software Development Agents in Real-World GitHub Scenarios16 Mar
- 2024Evaluating Software Development Agents: Patch Patterns, Code Quality, and Issue Complexity in Real-World GitHub Scenarios16 Oct
- 2024OpenHands: An Open Platform for AI Software Developers as Generalist Agents23 Jul
- 2024MAGIS: LLM-Based Multi-Agent Framework for GitHub Issue Resolution26 Mar
Other references · 10
- 2023SWE-bench: Can Language Models Resolve Real-World GitHub Issues?cited by 3,373
- 2025Multi-SWE-bench: A Multilingual Benchmark for Issue Resolvingcited by 171
- 2020A Fine-grained Data Set and Analysis of Tangling in Bug Fixing Commitscited by 11
- 2015Untangling Fine-Grained Code Changescited by 10
- 2020On the Relationship between Refactoring Actions and Bugs: A Differentiated Replicationcited by 5
- 2025How Safe Are AI-Generated Patches? A Large-scale Study on Security Risks in LLM and Agentic Automated Program Repair on SWE-benchcited by 5
- 2024Bug Priority Change: An Empirical Study on Apache Projectscited by 3
- 2025A Survey of Reinforcement Learning for Software Engineeringcited by 3
- 2026How do Agents Refactor: An Empirical Studycited by 3
- 2025Refactoring neq Bug-Inducing: Improving Defect Prediction with Code Change Tactics Analysiscited by 2
Built on by
Citing papers per year: 2026: 1.
1 paper.
- 2026Runnable Commit Untangling for Coding Agentscited by 0
- 2026Runnable Commit Untangling for Coding Agents8 Oct 2026
Similar, not cited
Close in wording, no citation either way
- 2026CodeTaste: Can LLMs Generate Human-Level Code Refactorings?
- 2025RefAgent: A Multi-agent LLM-based Framework for Automatic Software Refactoring
- 2025MANTRA: Enhancing Automated Method-Level Refactoring with Contextual RAG and Multi-Agent LLM Collaboration
- 2026RefactorPlatform: An Open-Source Harness for Controlled Evaluation of Repository-Scale Refactoring Agents
- 2026RefactorAssist: Agentic Refinement for Reliable Code Refactoring
- 2026REFINE: A Multi-Agent LLM Approach for Evidence-Guided Code Refactoring
- 2026SmellBench: Towards Fine-Grained Evaluation of Code Agents on Refactoring Tasks
- 2026A Unified Issue Resolution Benchmark for Requirement Clarification, Planning, and Code Generation for Coding Agents