SWE-Review:以代理式程式碼審查實現問題解決的閉環
SWE-Review: Closing the Loop on Issue Resolution with Agentic Code Review
July 7, 2026
作者: Ruoyu Wang, Jierun Chen, Shaowei Wang, Chaofan Tao, Sidi Yang, Yuxin Jiang, Kim-Hui Yap, Lifeng Shang, Xiaohui Li, Haoli Bai
cs.AI
摘要
程式編碼代理越來越多地為實際軟體問題生成拉取請求(PR),但一次性 PR 生成仍處於開環狀態:PR 在未經系統性審查、診斷或修訂的情況下直接提出。我們提出 SWE-Review 框架,透過代理式程式碼審查來閉合此迴路。給定一個問題與 AI 生成的 PR,審查代理會探索程式碼倉庫,決定 PR 是否應被接受,並提供結構化的修訂反饋。我們使用提出的 SWE-Review-Bench 來評估此設定,衡量審查正確性與下游修訂的有用性。我們進一步整理 SWE-Review-Traj 資料集,以研究代理式審查的更廣泛應用,並填補開放式審查訓練的資料稀缺缺口。實驗顯示,代理式審查透過「生成-審查-修訂」循環持續改進 PR,在決策準確性與修訂後解決率上均優於單輪固定上下文審查,其能力可遷移至審查之外、提升問題解決模型,並實現有效且高效的測試時擴展。這些結果將代理式程式碼審查定位為實用機制,推動 AI 編碼代理從一次性 PR 生成朝向閉環問題解決邁進。
English
Coding agents increasingly generate pull requests (PRs) for real-world software issues, yet one-shot PR generation remains open-loop: the PR is proposed without systematic review, diagnosis, or revision. We introduce SWE-Review, a framework for closing this loop with agentic code review. Given an issue and an AI-generated PR, a reviewer agent explores the repository, decides whether the PR should be accepted, and provides structured feedback for revision. We evaluate this setting with our proposed SWE-Review-Bench to measure both review correctness and downstream revision usefulness. We further curate SWE-Review-Traj dataset to study broader applications of agentic review and fill the data-scarcity gap for open reviewer training. Experiments show that agentic review continuously improves PRs through a generate-review-revise loop, outperforms single-turn fixed-context review in both decision accuracy and resolve rate after revision, transfers beyond review to improve issue-resolution models, and enables effective and efficient test-time scaling. These results position agentic code review as a practical mechanism for moving AI coding agents from one-shot PR generation toward closed-loop issue resolution.