SWE-Review: Closing the Loop on Issue Resolution with Agentic Code Review
TL;DR Highlight
AI가 생성한 PR을 자동으로 리뷰하고 수정 피드백까지 주는 에이전트 프레임워크로, resolve rate를 최대 2배 가까이 끌어올렸다.
Who Should Read
AI 코딩 에이전트(Devin, Claude Code 등)를 프로덕션에 붙이거나, LLM으로 코드 리뷰 자동화를 구축하려는 백엔드/DevOps 개발자. 테스트 없이 one-shot으로 PR 머지하는 파이프라인의 품질을 높이고 싶은 팀에 특히 유용하다.
Core Mechanics
- 기존 AI 코딩 에이전트는 PR을 생성하고 끝나는 'open-loop' 구조 — 리뷰도, 진단도, 수정도 없다. SWE-Review는 여기에 리뷰어 에이전트를 끼워 넣어 generate → review → revise 루프를 만든다.
- 리뷰어 에이전트는 저장소를 직접 탐색하며 증거를 수집한 뒤 approve/request-changes 결정을 내리고, 거절 시에는 어느 파일 몇 번째 줄이 문제인지 구체적인 진단(diagnosis)을 함께 제공한다.
- 단순히 diff만 보는 single-turn 리뷰와 달리, 에이전트 리뷰는 콜 체인을 따라가며 버그의 근본 원인(root cause)을 찾아낸다 — sympy 사례에서 single-turn은 증상 수정 PR을 approve했지만 에이전트는 upstream 버그를 잡아냈다.
- SWE-Review-Bench(1,384개 PR)와 SWE-Review-Traj(8,914개 리뷰 궤적 데이터셋)을 공개해서 오픈 리뷰어 학습과 평가를 지원한다.
- 리뷰 궤적 데이터로 Qwen3-8B를 SFT(지도학습 파인튜닝)하면 completion rate가 ~4%에서 71~84%로, decision accuracy가 랜덤 수준에서 67~72%로 올라간다.
- 리뷰 궤적을 이슈 해결 데이터와 혼합 학습하면 단순 코드 생성 능력까지 올라간다 — 같은 모델이 PR 생성 + 리뷰 + 수정을 모두 수행하는 단일 에이전트가 된다.
- Test-time scaling 전략으로 review-guided iterative revision이 가장 효율적 — 최대 5샘플 예산에서 평균 2.44샘플만 써서 resolve rate를 22.9% → 38.4%로 올린다.
Evidence
- generate-review-revise 루프 적용 시 SWE-bench Verified resolve rate: Qwen3-30B-A3B 27.5% → 56.9% (+29.4pp), Qwen3-Coder-30B-A3B 50.9% → 68.8% (+17.9pp), GLM-5 72.2% → 75.4% (+3.2pp).
- 에이전트 리뷰 vs single-turn 리뷰(diff+context), Qwen3-30B-A3B 기준 RRR(수정 후 resolve rate): 52.6% vs 44.1% — no-review 베이스라인 27.5% 대비 에이전트 리뷰가 거의 2배.
- Qwen3-8B SFT 후 completion rate 4% → 71~84%, decision accuracy +18~21pp 향상 (Table 2).
- 혼합 학습(이슈 해결 2k + 리뷰 2k) 시 직접 resolve rate 31.2% → 36.8%, review-then-revise 최종 resolve rate 31.2% → 41.8% (Table 3).
- Test-time scaling 토큰 효율: review-guided iterative revision 2.28pp/Mtok vs reviewer-gated resampling 0.35pp/Mtok — 6.5배 차이 (Table 14).
How to Apply
- 기존 AI 코딩 에이전트(Claude Code, Aider 등) 뒤에 리뷰어 에이전트를 붙이면 된다. 리뷰어는 저장소 접근 권한과 코드 실행 환경만 있으면 되고, approve가 나올 때까지 PR을 거부-수정 루프로 돌린다. 논문의 프롬프트(Appendix E.2)를 그대로 가져다 쓸 수 있다.
- 오픈소스 소형 리뷰어가 필요하다면 SWE-Review-Traj 데이터셋으로 Qwen3-8B를 파인튜닝하면 된다. 리뷰 데이터만 써도 되고, 이슈 해결 데이터와 1:1로 섞으면 코드 생성 능력까지 같이 올라간다.
- Test-time scaling 비용을 줄이고 싶다면 best-of-N 방식 대신 review-guided iterative revision을 쓰면 된다. 리뷰어가 reject하면 피드백을 붙여서 재생성하는 구조라 평균 2~3샘플로 best-of-16과 비슷하거나 더 나은 성능을 낸다.
Code Example
# Appendix E.2에서 가져온 아gentic 리뷰 프롬프트 핵심 구조
# 리뷰어 에이전트에게 넘길 system prompt 골격
REVIEW_SYSTEM_PROMPT = """
You are reviewing an AI-generated patch. Your job: determine if the patch
correctly fixes the root cause of the bug.
## Process
### Step 1: Read the Problem (NOT the patch yet)
Read the problem statement. Answer:
1. What does the user expect? (exact output/return value)
2. What actually happens? (error type + message, wrong output)
### Step 2: Find the Root Cause
Trace from the entry point down through the call stack.
Root cause = where the wrong value is created or wrong logic runs.
### Step 3: Write YOUR Proposed Fix (BEFORE reading the patch)
Commit to what you would change and why.
### Step 4: Read and Apply the Patch
Compare the patch to your Step 3 proposal.
HARD RULE - Symptom fix detection -> request_changes if:
- The patch is at a shallower location than your root cause
- The patch adds a guard at the point of USE instead of fixing point of CREATION
### Step 5: Verify Complete Behavior
Write and run tests:
1. Bug reproduction test
2. Full output/behavior check (not just 'no exception')
3. Regression test
### Step 6: Write Report
"""
REVIEW_OUTPUT_SCHEMA = {
"decision": {
"recommendation": "approve | request_changes",
"confidence": "0.0 to 1.0"
},
"summary": {
"problem": "1 sentence: root cause (file + function + what's wrong)",
"solution": "2-4 sentences: what the patch changes and whether it matches root cause",
"overall_assessment": "1-2 sentences: verdict with reason"
},
"defects": [
{
"severity": "high | medium | low",
"category": "correctness | compatibility | security | performance | maintainability",
"location": {"path": "exact/file/path.py", "start_line": "N", "end_line": "N"},
"description": "What is wrong: specific code, condition, failure",
"suggestion": "In file.py function foo(), change X to Y"
}
]
}
# 리뷰 피드백을 받아서 revision 에이전트에 넘기는 예시
def run_review_revision_loop(issue, pr, repo_path, max_rounds=5):
for round in range(max_rounds):
review = reviewer_agent(issue, pr, repo_path) # 에이전트 리뷰 실행
if review["decision"]["recommendation"] == "approve":
return pr # 승인되면 종료
# 거절 시 진단 내용을 revision 에이전트에게 전달
feedback = format_feedback(review["defects"])
pr = revision_agent(issue, pr, feedback, repo_path) # 수정
return prTerminology
Related Papers
Migrating a production AI agent to GPT-5.6: 2.2x faster, 27% cheaper
마케팅 웹사이트를 자동 생성하는 프로덕션 AI 에이전트를 Claude Opus 4.8에서 GPT-5.6 Sol로 전환한 실전 경험담으로, 단순 모델 교체가 아니라 eval 하네스, 툴 스키마, 캐싱, 추론 리플레이까지 손봐야 했던 과정을 구체적인 수치와 함께 정리했다.
What xAI's Grok build CLI sends to xAI: A wire-level analysis
xAI의 공식 코딩 CLI 도구 Grok Build가 사용자 동의 없이 전체 Git 저장소와 .env 시크릿 파일을 xAI 서버로 업로드한다는 사실이 네트워크 트래픽 분석으로 밝혀졌다.
Remember When It Matters: Proactive Memory Agent for Long-Horizon Agents
LLM 에이전트가 긴 작업 중 중요한 정보를 잊어버리는 문제를 별도의 메모리 에이전트가 '적절한 타이밍에' 끼어들어 해결하는 방법
WebSwarm: Recursive Multi-Agent Orchestration for Deep-and-Wide Web Search
복잡한 웹 검색을 재귀적으로 분해하고 각 노드에 적합한 검색 모드를 동적으로 할당하는 멀티에이전트 프레임워크
Show HN: Reverse-engineering web apps into agent tools
로그인된 웹 앱의 API 호출을 브라우저에서 감시해 자동으로 MCP 도구로 변환하는 에이전트를 만들었다. 소스 코드나 공식 API 문서 없이도 Jira, Spotify 같은 서비스에 AI 어시스턴트를 붙일 수 있다.
Show HN: FableCut – A browser video editor AI agents can drive (zero deps)
타임라인 전체를 JSON 파일 하나로 표현하고 MCP/REST로 AI 에이전트가 직접 편집할 수 있는 브라우저 비디오 에디터로, Claude 같은 AI가 프롬프트 하나로 영상을 자동 컷편집하고 결과를 실시간으로 UI에 반영해준다.
Related Resources
Original Abstract (Expand)
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.