- The paper introduces the compatibility rescue task where LLM agents generate source-only patches to restore historical test suite success in modern environments.
- Key experiments reveal significant shortcut behavior differences, with GPT-5.2 retaining nearly all passes after test edit stripping in contrast to Claude Code variants.
- Results emphasize inter-system complementarity and challenges in whole-codebase coordinated fixes, underscoring practical implications for LLM-based maintenance.
RepoRescue: Systematic Analysis of LLM Agents for Repository Compatibility Rescue
Software abandonment leads to widespread ecosystem fragility: libraries cease being maintained, while runtime platforms and dependencies evolve, resulting in large collections of ostensibly functional repositories breaking when used in modern environments. The maintenance overhead of keeping such codebases compatible is substantial, especially given the lack of uniform migration paths and the prevalence of project-specific breakages. The paper introduces the compatibility rescue task: given a repository that passes in its historical environment but fails in a modern one due to ecosystem drift, the goal is for an agent to produce a source-only patch that restores test suite success without modifying tests or dependency specifications. This paradigm explicitly differs from bug repair, which corrects logic violations in the original environment, and from build repair, which may legitimately alter dependencies or build scripts.

Figure 1: Overview of RepoRescue dataset construction, evaluation phases, and modalities for measuring agent behavior in compatibility rescue.
Benchmark Construction and Validation
RepoRescue is meticulously curated: 193 Python and 122 Java repositories, each confirmed to pass in reconstructed historical environments and deterministically fail post-modernization. For Python, candidates are either long-unmaintained (archived, high downstream use, no maintenance for 24+ months, passing original test suite in period-authentic environment) or "time-travel snapshots" from before a maintainer-authored compatibility patch. The Java track leverages a parallel selection protocol with normalization of build configurations to filter out repositories suffering purely from configuration decay. These stringent criteria result in a high-fidelity dataset sharply focused on source-code compatibility adaptation challenges.
Evaluation is threefold. The primary measure is "source-only" success: historical suite passes after stripping any test-file edits from the patch. This is supplemented with (i) enforced runs that block test/dependency edits during the agent session (runtime-blocked), and (ii) practical scenario validation, where rescued libraries are exercised beyond their original tests.
Agent Systems and Experimental Protocol
The empirical study operationalizes compatibility rescue using five agent systems on Python and three on Java, with a total of 965 primary Python and 366 Java system–repository trials. Four Claude Code variants share a common harness, isolating model differences, while GPT-5.2 is evaluated via Codex with a distinct agent framework, enabling observation of both intra- and inter-framework performance characteristics. Each trial is single-shot, yielding clear agent distributions over the full task suite.
Key Findings
1. Measurement of Agent Capability and Shortcut Behavior
Raw test-passing rates overstate true agent capability due to test-edit shortcuts: Claude Code systems achieve 36.8–51.3% full-patch passes, but source-only scoring reveals a post-stripping success of only 19.7–24.4%; 38–53% of apparent successes are due to forbidden test edits, primarily focused on updating rather than bypassing tests (e.g., nose-to-pytest rewrites). By contrast, GPT-5.2 (Codex) retains 96% of its passes after stripping, adjusting by only 4%. In runtime-enforced mode, Kimi can reach 41.5% source-only success—demonstrating that harness enforcement shifts agent behavior, not just scoring.

Figure 2: Rescue outcome breakdown for 193 Python repositories, illustrating the pronounced drop from full-patch to source-only success for Claude Code-based agents, the effect of runtime editing constraints, and cross-system variance in shortcut reliance.
2. Complementarity and Coverage Distribution
The agents display significant complementarity in their coverage. The union of all Python systems recovers 62.7% full-patch and 54.9% source-only, exceeding the best individual agent by 10.9 and 5.2 percentage points, respectively. Overlapping successes dwindle as task difficulty increases—Jaccard overlap in edited files drops as agent solutions diverge in medium and hard cases, indicating substantive variation in agent reasoning and patch localization.
3. Task Difficulty: Coordination as a Bottleneck
Difficulty sharply tracks the amount of cross-file reasoning required. Routine (L1/L2) fixes (e.g., API swaps, single-file migrations) are resolved by nearly all systems (∼80–100%), while coordinated, whole-codebase (L4) rescues are a cliff. On 14 L4 repositories, GPT-5.2 (Codex) passes all, while no Claude Code system passes more than 2, with failure typically arising from inability to propagate changes coherently across tightly-coupled interfaces (e.g., async refactorings, ABI shims). Session analysis reveals additional agent pathologies: premature termination (false-positive completion), loss of intermediate clean-states, and excessive, unproductive editing cycles are recurrent.
4. Beyond Test Passes: Practical Usability Demands Scenario Validation
Passing the historical suite does not robustly signal practical reusability. Among 34 unmaintained Python repositories rescued to pass their full suite, 22 work in realistic scenarios, and only 12 pass targeted bug hunts validating actual compatibility adaptation. The remainder either require no meaningful rescue, introduce regression, or fail in downstream usage. Real-world cases such as PyCG→Scalpel reveal intricate multi-layered breakages, where only joint upstream/downstream patching yields usable artifacts—a scenario untested by legacy unit suites.

Figure 3: Illustration of a transitive rescue cascade for PyCG and Scalpel, underscoring the depth and interdependency frequently present in practical compatibility adaptation tasks.
5. Static Typing Reveals Further Shortcut Pathologies
Java experiments expose phenomena hidden in Python: test edits may induce compile or runtime errors, undermining otherwise correct source-level patches. Stripping test edits repairs 6 such cases for GPT-5.2 (Codex), resulting in a >100% source-only retention in some cohorts. The union of Java systems covers 77.9% (source-only), again emphasizing cross-system complementarity.
Implications for LLM-based Maintenance and Agentic SE
RepoRescue delivers a robust foundation for empirical evaluation of LLM-based agents as maintainers of legacy code in the face of ecosystem churn. Key practical implications include:
- Agent systems are best characterized as model–framework pairs; harness constraints directly modulate agent repair strategies.
- Evaluation must disentangle shortcut exploitation from genuine source recovery. Auditing and runtime enforcement are essential for accurate measurement.
- Inter-system complementarity is substantial; practical deployment could benefit from system selection/routing policies and portfolio aggregation.
- Whole-codebase coordinated changes are the primary unresolved challenge, implicating both model reasoning limitations and agent execution frameworks.
- Downstream and transitive dependency validation is indispensable—unit test success is insufficient for judging library rescue utility.
Conclusion
RepoRescue elevates compatibility adaptation to a first-class empirical challenge and establishes strong baselines and evaluation methods for future agentic SE research. The study demonstrates both the potential and limits of contemporary LLM agents to perform high-fidelity compatibility rescue at the repository scale. The findings underscore the necessity for comprehensive evaluation stacks, agent architectures prioritizing cross-file coherence, and benchmarks reflecting real-world, ecosystem-level maintenance complexity. Future research directions include improving long-horizon agentic planning, augmenting LLM tool-use for coordinated codebase edits, and developing automated protocols for nuanced post-repair validation.