Controlled harness reveals what helps agents refactor entire repositories

Across 100 multi-file tasks, structured code retrieval improved agent performance, while naive retrieval and the tested delegation setup underperformed.

PaperIndustrycs.CLarXiv:2609.04898v1
Aziz Ben Amor · Drish Mali · Mann Acharya · Vijayasri Iyer · Sébastien Bratières

Pi School · Translated

Research Digest··2 min read
Ben Amor et al. built RefactorPlatform, an open-source harness for comparing repository-scale refactoring agents under controlled conditions. Experiments across four model families show that AST-aware retrieval—organizing code by its syntactic structure—substantially improves success, while their multi-agent configuration trails a lean retrieval-augmented single agent.

What they did

The authors evaluated agents on 100 multi-file RefactorBench tasks, holding the execution environment fixed while varying model backbone, prompt specificity, and execution regime: retrieval-free baseline, retrieval-augmented single agent, or multiple agents.

RefactorPlatform runs each attempt in an isolated workspace and records tokens, code diffs, transcripts, and other telemetry. It supports OpenRouter models and GitHub Copilot CLI, streams terminal activity, and uses abstract syntax tree (AST)-based checks to verify refactorings.

Key findings

  • AST-aware code chunking outperformed naive fixed token-window chunking by 25–30 percentage points across prompt modes.
  • Naive retrieval performed worse than the retrieval-free baseline, indicating that adding context without structuring it can hinder an agent.
  • On matched tasks, the retrieval-augmented single agent succeeded on 86%, compared with 66% for the evaluated multi-agent configuration. No task was solved only through delegation.
  • Retrieval increased token use, but its higher accuracy left the cost per successful refactoring effectively unchanged.

Why it matters

Repository-scale coding evaluations often change models, prompts, retrieval systems, and orchestration simultaneously, making results difficult to interpret. RefactorPlatform provides a reproducible way to isolate those choices and suggests that careful context selection may matter more than adding agent complexity.

Caveats

The demonstration covers 100 tasks and one particular sub-agent design, so it does not establish that single-agent systems generally outperform multi-agent ones. Results may also vary with other repositories, refactoring types, retrieval methods, models, and verification criteria; broader testing is needed to establish generality.

§
newspaper

Research Digest

Articles published under the Zotpaper byline are synthesized from multiple source publications by our AI editor and reviewed by our editorial process. Each story combines reporting from credible outlets to give readers a balanced, comprehensive view.