HAFixAgent: History-Aware Program Repair Agent
Yu Shi, Hao Li, Bram Adams, Ahmed E. Hassan

TL;DR
HAFixAgent leverages repository history to enhance large language model-based automated program repair, significantly improving success rates, robustness, and efficiency, especially for complex multi-hunk bugs.
Contribution
This work introduces HAFixAgent, a novel history-aware repair agent that injects repository heuristics into the repair process, improving performance over existing methods.
Findings
HAFixAgent outperforms RepairAgent (+56.6%) and BIRCH-feedback (+47.1%) on Defects4J.
Historical context improves repair success by +4.4% on Defects4J and +38.6% on BugsInPy.
History increases resilience under noisy fault localization, maintaining 40-56% success on complex bugs.
Abstract
Automated program repair (APR) has recently shifted toward large language models and agent-based systems, yet most systems rely on local snapshot context, overlooking repository history. Prior work shows that repository history helps repair single-line bugs, since the last commit touching the buggy line is often the bug-introducing one. In this paper, we investigate whether repository history can also improve agentic APR systems at scale, especially for complex multi-hunk bugs. We present HAFixAgent, a History-Aware Bug-Fixing Agent that injects blame-derived repository heuristics into its repair loop. A preliminary study on 854 Defects4J (Java) and 501 BugsInPy (Python) bugs motivates our design, showing that bug-relevant history is widely available across both benchmarks. Using the same LLM (DeepSeek-V3.2-Exp) for all experiments, including replicated baselines, we show: (1)…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
