VITAL-RAG: Invariance Race for Context Allocation in Coding Agents
Abstract
Coding agents often retrieve code from an entire repository, but only limited evidence can fit into the final model input. Conventional retrieval-augmented generation (RAG) for coding agents treats fragments from the same code object as separate results, so redundant views can occupy multiple context positions and crowd out useful code. Grouping fragments by code object reduces this redundancy, but can discard local information needed for the task. We describe this tension as an invariance race: allocation should stay stable under redundant renderings but change when a fragment adds task-relevant semantics. To address this race, we introduce VITAL-RAG, which organizes evidence by canonical code object, keeps one query-relevant companion only when it adds semantics not already represented, and renders selected evidence under per-object and global token budgets. On RepoBench, VITALRAG improves Recall@4K from 39.59% to 63.67% while reducing evidence tokens by 35.63%. Across three model backends, it matches or outperforms recent baselines on RepoClassBench and achieves the highest raw Pass@1 on RepoExec.
Cite
@article{arxiv.2607.26937,
title = {VITAL-RAG: Invariance Race for Context Allocation in Coding Agents},
author = {Zijian Lu and Yonghua Lu and Mingcai Chen and Yiping Zuo and Xin He and Weijun Wang and Weibei Fan},
journal= {arXiv preprint arXiv:2607.26937},
year = {2026}
}
Comments
8 pages, 2 figures