SelfHeal: Empirical Fix Pattern Analysis and Bug Repair in LLM Agents
On the map: LLM agents and tool use → Software engineering coding agents
Abstract (arXiv)
Large Language Models (LLMs) have transformed software development and AI applications. While LLMs are designed for text processing, LLM agents extend this capability by enabling autonomous actions, tool use, and multi-step task completion. As this field grows, developers face new challenges in debugging these complex systems. To address this challenge, we present the first empirical study on bug fix patterns in LLM agents. We study buggy posts and code snippets from three platforms: Stack Overflow, GitHub, and HuggingFace Forums. We examine their fix patterns, the components where fixes are applied, and the programming languages and frameworks involved. Furthermore, we introduce AgentDefect, the first benchmark dataset for bugs in LLM agents. The dataset contains 37 runtime buggy instances along with fixed code and test files. Finally, we present SelfHeal, a multi-agent system designed to fix bugs in LLM agents. The system leverages two independent ReAct agents: the fix agent and the critic agent. These agents use tools that provide both internal knowledge (fix rules) and external knowledge (web search) to propose and validate fixes. Our evaluation shows that SelfHeal with Gemini 3 Pro as the backbone LLM outperforms both baseline and state-of-the-art approaches by a significant margin.
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 15 of its 66 references that are in the map. First posted on arXiv 20 Apr 2026.
Builds on
15 of 66 references.
Closest ancestors · 4
Same direction, newest first
- 2026When Agents Fail: A Comprehensive Study of Bugs in LLM Agents with Automated Labeling21 Jan
- 2025TRAIL: Trace Reasoning and Agentic Issue Localization13 May
- 2025Interactive Debugging and Steering of Multi-Agent AI Systems3 Mar
- 2024Large Language Model-Based Agents for Software Engineering: A Survey4 Sep
Other references · 11
- 2023LLaMA: Open and Efficient Foundation Language Modelscited by 14,132
- 2023Qwen Technical Reportcited by 3,344
- 2023AgentTuning: Enabling Generalized Agent Abilities for LLMscited by 338
- 2019A Comprehensive Study on Deep Learning Bug Characteristicscited by 65
- 2021DeepLocalize: Fault Localization for Deep Neural Networkscited by 38
- 2025From Language to Action: A Review of Large Language Models as Autonomous Agents and Tool Userscited by 32
- 2024The Future of AI-Driven Software Engineeringcited by 23
- 2024MORepair: Teaching LLMs to Repair Code via Multi-Objective Fine-tuningcited by 13
- 2020Proof Repair across Type Equivalencescited by 8
- 2024Anomaly Detection in Large-Scale Cloud Systems: An Industry Case and Datasetcited by 7
- 2024The Impact Of Bug Localization Based on Crash Report Mining: A Developers' Perspectivecited by 2
Built on by
Citing papers per year: 2026: 1.
1 paper.
Similar, not cited
Close in wording, no citation either way
- 2024An Empirical Study on LLM-based Agents for Automated Bug Fixing
- 2024MarsCode Agent: AI-native Automated Bug Fixing
- 2024Defining and Detecting the Defects of the Large Language Model-based Autonomous Agents
- 2026If It's Not Buggy, Don't Fix It: On the Dynamics of Iterative Bug-fixing with LLMs
- 2025SWE-Synth: Synthesizing Verifiable Bug-Fix Data to Enable Large Language Models in Resolving Real-World Bugs
- 2024RepairAgent: An Autonomous, LLM-Based Agent for Program Repair
- 2025Agentic Program Repair from Test Failures at Scale: A Neuro-symbolic approach with static analysis and test execution feedback
- 2026Understanding Agent-Reactive Bugs at the Model-Harness Boundary: An Empirical Study of LLM Agent Issue Reports