HAFixAgent: History-Aware Automated Program Repair Agent
Shi, Yu, Li, Hao, Adams, Bram, Hassan, Ahmed E.
–arXiv.org Artificial Intelligence
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 of all 854 real-world bugs from Defects4J motivates our design, showing that bug-relevant history is both widely available and highly concentrated. Empirical comparison of HAFixAgent with two state-of-the-art baselines shows: (1) Effectiveness: HAFixAgent significantly improves over the agent-based baseline (by 212.3%) and the multi-hunk baseline (by 29.9%). (2) Efficiency: history does not significantly increase agent steps and keeps token costs comparable, with notably lower median costs for complex multi-file-multi-hunk bugs. (3) Practicality: combining different historical heuristics repairs more bugs, offering a clear cost-benefit trade-off. HAFixAgent offers a practical recipe for history-aware agentic APR: ground the agent in version control history, prioritize diff-based historical context, and integrate complementary heuristics when needed.
arXiv.org Artificial Intelligence
Nov-6-2025
- Country:
- Africa
- Rwanda > Kigali
- Kigali (0.04)
- South Africa > Western Cape
- Cape Town (0.04)
- Rwanda > Kigali
- Asia
- China
- Beijing > Beijing (0.04)
- Zhejiang Province > Hangzhou (0.04)
- Japan > Honshū
- Kansai > Osaka Prefecture
- Osaka (0.04)
- Kantō > Tokyo Metropolis Prefecture
- Tokyo (0.14)
- Kansai > Osaka Prefecture
- Myanmar > Tanintharyi Region
- Dawei (0.04)
- Singapore > Central Region
- Singapore (0.04)
- South Korea > Seoul
- Seoul (0.04)
- Thailand > Bangkok
- Bangkok (0.04)
- China
- Europe
- Austria > Vienna (0.14)
- Germany > Saarland
- Saarbrücken (0.04)
- Greece > Attica
- Athens (0.04)
- Italy (0.04)
- Portugal > Lisbon
- Lisbon (0.04)
- Spain > Galicia
- Madrid (0.04)
- Sweden > Vaestra Goetaland
- Gothenburg (0.04)
- United Kingdom > England
- Cambridgeshire > Cambridge (0.04)
- North America
- Canada
- British Columbia > Metro Vancouver Regional District
- Vancouver (0.04)
- Ontario
- Kingston (0.04)
- National Capital Region > Ottawa (0.04)
- Quebec > Montreal (0.04)
- British Columbia > Metro Vancouver Regional District
- United States
- California
- San Francisco County > San Francisco (0.28)
- Santa Clara County > San Jose (0.04)
- Hawaii > Honolulu County
- Honolulu (0.04)
- Illinois > Champaign County
- Urbana (0.04)
- Minnesota > Hennepin County
- Minneapolis (0.14)
- Missouri (0.04)
- Pennsylvania > Philadelphia County
- Philadelphia (0.04)
- Texas > Travis County
- Austin (0.04)
- California
- Canada
- Oceania > Australia
- South America > Brazil (0.04)
- Africa
- Genre:
- Research Report
- Experimental Study (1.00)
- New Finding (1.00)
- Research Report
- Industry:
- Information Technology (0.46)
- Technology: