# Rivet: Utility-Preserving Context Control for Repository-Level Coding Agents

DevFeed: [Rivet: Utility-Preserving Context Control for Repository-Level Coding Agents](<https://devfeed.tech/articles/rivet-utility-preserving-context-control-for-repository-level-coding-agents-101796.md>)

Original publisher: [Read original article](<https://arxiv.org/abs/2610.34967>)

Author: Ruwei Pan, Linhao Wu, Yakun Zhang, Zixiong Yang, Lu Zhang, Hongyu Zhang

Published: 2026-10-27T04:00:00Z

Content type: article

Language: en

Sources: [arXiv: Software Engineering](<https://devfeed.tech/sources/arxiv-software-engineering.md>)

Topics: [agentic-coding](<https://devfeed.tech/topics/agentic-coding.md>), [AI-assisted coding](<https://devfeed.tech/topics/ai-assisted-coding.md>), [Retrieval Augmented Generation (RAG)](<https://devfeed.tech/topics/retrieval-augmented-generation-rag.md>), [Repository](<https://devfeed.tech/topics/repository.md>)

Tags: [4k](<https://devfeed.tech/tags/4k.md>), [8k](<https://devfeed.tech/tags/8k.md>), [abstract](<https://devfeed.tech/tags/abstract.md>), [agent](<https://devfeed.tech/tags/agent.md>), [agents](<https://devfeed.tech/tags/agents.md>), [all](<https://devfeed.tech/tags/all.md>), [arxiv](<https://devfeed.tech/tags/arxiv.md>), [benchmarks](<https://devfeed.tech/tags/benchmarks.md>), [budget](<https://devfeed.tech/tags/budget.md>), [but](<https://devfeed.tech/tags/but.md>), [call](<https://devfeed.tech/tags/call.md>), [can](<https://devfeed.tech/tags/can.md>), [code](<https://devfeed.tech/tags/code.md>), [code-generation](<https://devfeed.tech/tags/code-generation.md>), [coding](<https://devfeed.tech/tags/coding.md>), [coding-agents](<https://devfeed.tech/tags/coding-agents.md>), [context](<https://devfeed.tech/tags/context.md>), [control](<https://devfeed.tech/tags/control.md>), [cs-se](<https://devfeed.tech/tags/cs-se.md>), [repository](<https://devfeed.tech/tags/repository.md>), [utility](<https://devfeed.tech/tags/utility.md>)

## AI overview

Rivet aims to prevent "context utility dilution": repository context can look task-relevant while omitting evidence needed to implement and integrate code. It selects code anchors using lexical, semantic, and structural signals, follows dependency, usage, and configuration links to gather related evidence, then prioritizes that evidence under a token budget, shortening snippets to signatures or summaries before dropping them. On DevEval and RepoExec, across four backbone models, 4K and 8K token budgets, and eight baselines, the abstract reports the highest Pass@1 in all 16 settings and a 3.73-5.15 percentage-point average gain over the strongest baseline. It also reports GPT-5-mini with Rivet outperforming GPT-5 without Rivet on both benchmarks while reducing inference cost by 73.3-84.5%. These are abstract-level reported results; the supplied text does not include evaluation details.

## Source excerpt

arXiv:2610.34967v1 Announce Type: new Abstract: Repository-level code generation asks an agent to implement a task requirement inside an existing repository. To produce code that works in the repository, the agent needs repository evidence, such as target locations, helper definitions, caller usages, and configuration constraints, which determine how the code should be located, integrated, and executed. Because the context budget cannot hold the entire repository, existing retrieval, compression, and structure-aware methods select context by task similarity, context length, or structural proximity, but these criteria do not directly measure whether the selected context contains this evidence. As a result, the selected context can appear relevant to the task yet miss the evidence that the implementation depends on. We call this failure mode context utility dilution. In this paper, we propose Rivet, a context control framework that preserves repository evidence for coding agents under a fixed context budget. Rivet, first uses Signal Grounding to select task-related code anchors by fusing lexical, semantic, and structural signals. Utility Linking then expands these anchors through dependency, usage, and configuration relations to collect repository evidence. Finally, Budget Shaping packs the evidence by priority and, when the budget is tight, reduces snippets to signatures or summaries before dropping them. We evaluate Rivet, on two executable repository-level benchmarks, DevEval and RepoExec, with four backbone models, two context budgets (4K and 8K tokens), and eight baselines. Rivet, achieves the highest Pass@1 in all 16 settings and improves over the strongest baseline by 3.73--5.15 percentage points on average. Moreover, GPT-5-mini with Rivet, outperforms GPT-5 without Rivet,on both benchmarks while reducing inference cost by 73.3%--84.5%.