HAFixAgent: History-Aware Agentic Program Repair
cs.SE, cs.AI
Submitted: 2025-11-02
Updated: 2026-10-08
Comments: Evaluation: on both realistic spectrum-based fault localization and perfect fault localization Benchmarks: Defects4J and BugsInPy Subject LLMs: DeepSeek-V3.2-Exp, Qwen3-Coder-Next, and Devstral-Small-2
Code: https://github.com/deepseek-ai/DeepSeek-V3.2-
License: http://creativecommons.org/licenses/by/4.0/
The gist: Automated program repair (APR) has recently shifted toward large language models and agent-based systems, while prior work shows that repository history can help repair single-line bugs.
Terminology
Abstract
Automated program repair (APR) has recently shifted toward large language models and agent-based systems, while prior work shows that repository history can help repair single-line bugs. We conduct a large-scale empirical study of whether, how much, and under what conditions repository history improves agentic APR beyond this setting. We present HAFixAgent, a history-aware program repair agent that injects blame-derived repository context into its repair loop. Across 854 Defects4J (Java) and 501 BugsInPy (Python) bugs, we first show that bug-relevant history is widely available. We then evaluate HAFixAgent across three base models under perfect fault localization. The best history heuristic improves over non-history from +4.4% on Defects4J and +1.1% on BugsInPy with the strongest model to as much as +64.3% with weaker models. HAFixAgent also outperforms RepairAgent by +56.6% and BIRCH-feedback by +47.1% on the strongest model, showing that it is a strong repair agent independent of history. The three history heuristics are complementary: each repairs a different subset of bugs, so their hybrid significantly repairs more bugs than non-history (McNemar's test, p < 0.001), and this advantage persists under realistic spectrum-based fault localization. Individual history heuristics are generally no more expensive than non-history in agent steps or tokens under either localization setting, while the hybrid costs roughly twice a single run in a cascade setting.
Sources
- Evaluating Large Language Models Trained on Code
- SWE-Exp: Experience-Driven Software Issue Resolution
- DeepSeek-V3 Technical Report
- Hierarchical Knowledge Injection for Improving LLM-based Program Repair
- SWE-Effi: Re-Evaluating Software AI Agent System Effectiveness Under Resource Constraints
- Towards Effectively Leveraging Execution Traces for Program Repair with Code LLMs
- Agentic Software Engineering: Foundational Pillars and a Research Roadmap
- UniDebugger: Hierarchical Multi-Agent Framework for Unified Software Debugging
- The Rise of AI Teammates in Software Engineering (SE) 3.0: How Autonomous Coding Agents Are Reshaping Software Engineering
- An Empirical Study on LLM-based Agents for Automated Bug Fixing
- EXPEREPAIR: Dual-Memory Enhanced LLM-based Repository-Level Program Repair
- Characterizing Multi-Hunk Patches: Divergence, Proximity, and LLM Repair Challenges
- A Multi-Agent Approach to Fault Localization via Graph-Based Retrieval and Reflexion
- Agentic AI for Software: thoughts from Software Engineering community
- HAFix: History-Augmented Large Language Models for Bug Fixing
- A Systematic Literature Review on Large Language Models for Automated Program Repair
Related papers
- Falsification-Based Verification of LLM-Generated Optimization Models: Sound Test Batteries and Their Detection Limits
- GitSkills: A Dataset of Agent Skills on GitHub
- SABER: Benchmarking Operational Safety of LLM Coding Agents in Stateful Project Workspaces
- PackMonitor: Enabling Zero Package Hallucinations Through Decoding-Time Monitoring
- IntentCoding: Amplifying User Intent in Code Generation
- Incentives and Outcomes in Bug Bounties