RepoRescue: LLM智能体在全仓库兼容性修复上的实证研究
RepoRescue: An Empirical Study of LLM Agents on Whole-Repository Compatibility Rescue
AI总结:
研究LLM智能体能否自动修复因环境演化而失效的旧仓库,提出RepoRescue基准,包含315个仓库,评估多种智能体系统,发现跨文件协调是主要难点,且系统间互补性显著。
摘要:
开源库和工具被广泛重用,但兼容性维护成本高昂。一旦维护者离开,随着运行时和依赖的演化,有用的仓库可能停止工作。我们研究LLM智能体是否能将旧仓库适配到现代环境,这一任务称为兼容性修复。与错误修复不同,兼容性修复从原本在其原始环境中正常工作但生态系统漂移后失败的仓库开始。RepoRescue仅向智能体提供仓库及其失败的现代环境;智能体必须诊断失败原因,定位受影响的代码,并生成恢复历史测试套件的源代码修复。我们从193个Python和122个Java仓库构建RepoRescue,每个仓库都经过验证,历史上能通过测试但在现代化后失败。我们在Python上评估了五个已部署的智能体系统,在Java上评估了三个。除了完整补丁通过率,我们还在移除测试文件编辑后重新运行补丁以衡量仅源代码修复,添加运行时强制机制阻止测试编辑,并验证那些修复后测试套件通过的仓库的实际用途。我们发现Claude Code系统有时即使被提示不要编辑也会修改失败的测试;使用运行时阻塞后,Kimi仍能修复41.5%的仓库。系统具有互补性:它们的联合达到62.7%,超过最佳单一系统10.9个百分点。难度集中在跨文件协调:在14个需要协调全代码库更改的仓库上,GPT-5.2通过Codex通过了全部14个,而每个Claude Code系统最多通过两个。最后,通过的测试套件仅是一个初始信号:在34个无人维护的Python候选仓库中,其测试套件在修复后通过,其中22个在现实场景中工作,12个通过补丁解决了兼容性故障的漏洞搜索。RepoRescue通过仅源代码审计、运行时强制、实际验证和推理标签对兼容性修复进行基准测试。
英文摘要:
Open-source libraries and tools are widely reused, but compatibility maintenance is expensive. Once maintainers leave, useful repositories can stop working as runtimes and dependencies evolve. We study whether LLM agents can adapt old repositories to modern environments, a task we call compatibility rescue. Unlike bug repair, compatibility rescue starts from a repository that worked in its original environment but fails after ecosystem drift. RepoRescue gives agents only the repository and its failing modern environment; the agent must diagnose the failure, locate affected code, and produce a source-code rescue that restores the historical test suite. We build RepoRescue from 193 Python and 122 Java repositories, each verified to pass historically and fail after modernization. We evaluate five deployed agent systems on Python and three on Java. Beyond full-patch pass rate, we rerun patches after removing test-file edits to measure source-only repair, add a runtime-enforced regime that blocks test edits, and validate practical use for repositories whose suites pass after rescue. We find that Claude Code systems sometimes edit failing tests even when prompted not to; with runtime blocking, Kimi still rescues 41.5% of repositories. Systems are complementary: their union reaches 62.7%, exceeding the best single system by 10.9 points. Difficulty concentrates in cross-file coordination: on 14 repositories requiring coordinated whole-codebase changes, GPT-5.2 through Codex passes all 14, while every Claude Code system passes at most two. Finally, a passing suite is only an initial signal: among 34 unmaintained Python candidates whose suites pass after rescue, 22 work in realistic scenarios and 12 pass bug-hunt with patches that address the compatibility failure. RepoRescue benchmarks compatibility rescue with source-only auditing, runtime enforcement, practical validation, and reasoning labels.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。