Reusing Past Repairs Through Hierarchical Trajectory Abstraction for Coding Agents
2026-07-31 • Software Engineering
Software Engineering
AI summaryⓘ
The authors present STAIR, a system that learns from past software bug fixes by turning them into reusable, step-by-step plans at different levels of detail. When a new bug appears, STAIR picks and adapts these plans to help fix the issue more effectively instead of starting from scratch each time. Their tests show STAIR improves bug-fixing success rates for various AI assistants, even those it was not originally paired with. They also found that combining plans from multiple detail levels works better than using just one level, and raw past fixes without structure were less helpful.
large language modelssoftware repairhierarchical planningtransfer learningprompt engineeringsoftware debuggingabstraction levelsmachine learning agentssoftware repositoriesSWE-bench
Authors
Yisen Xu, Jiayuan Zhou, Ruiqi Pan, Tse-Hsun Chen
Abstract
Although LLM-driven repair agents can tackle complex, repository-level issues, they treat every issue independently and discard the procedural knowledge accumulated from previous repairs. We introduce STAIR, a framework that converts historical repair trajectories into hierarchical, reusable plans that can be adapted to steer future repairs. Each past trajectory is transformed into a multi-level tree that ranges from fine-grained diagnostic actions to high-level repair strategies, encoding experience at several granularities. When a new issue arrives, STAIR selects relevant plan nodes from multiple abstraction levels, tailors them into executable, issue-specific plans, and supplies them to the agent through its prompt. On SWE-bench Verified, STAIR integrated with Lingxi reaches 81.2% Pass@1 using MiniMax M2.5 and 79.2% using GPT-5. The generated plans also generalize across agents: without any code change, they lift the Pass@1 of a structurally different agent, mini-SWE-agent v2, from 75.8% to 81.0%. Ablation experiments further show that mixing multiple abstraction levels surpasses any single level and that raw, unabstracted trajectories transfer substantially worse.