Reusing Past Repairs Through Hierarchical Trajectory Abstraction for Coding Agents

📅 2026-07-31
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
This work addresses the limitation of existing large language model–based code repair agents, which typically process tasks in isolation and struggle to reuse past repair experiences. To overcome this, the authors propose STAIR, a novel framework that introduces a hierarchical trajectory abstraction mechanism. STAIR constructs multi-granularity plan trees from historical repair trajectories, spanning from diagnostic actions to high-level strategies, and dynamically retrieves and adapts relevant nodes during new tasks to generate customized repair plans. Notably, this approach enables efficient cross-task and cross-agent experience transfer without modifying the target agent’s code. Experimental results on SWE-bench Verified demonstrate substantial performance gains: when integrated with the Lingxi agent, STAIR achieves Pass@1 scores of 81.2% (MiniMax M2.5) and 79.2% (GPT-5), and boosts mini-SWE-agent v2’s performance from 75.8% to 81.0%.
📝 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.
Problem

Research questions and friction points this paper is trying to address.

code repair
procedural knowledge reuse
trajectory abstraction
LLM agents
repair generalization
Innovation

Methods, ideas, or system contributions that make the work stand out.

hierarchical trajectory abstraction
repair plan reuse
LLM-based coding agents
procedural knowledge transfer
multi-level planning