arXiv:2610.35333cs.SEOct 2026

Manuscript Offprint

arXiv:2610.35333

RepoTrace: Improving Requirement Tracing in Multi-Round Agent Interactions

Huanyu Liu, Yezheng Cheng, Jinliang You, Tianxiao Huang, Linyu Li, Zheng Fang, Peng Cao, Ge Li

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

ABSTRACT

Code agents have become increasingly capable of performing software engineering tasks through interaction with software environments. However, agents tend to degrade as the number of interaction rounds increases, making it difficult to maintain existing software during iterative modification. We analyze 2,656 agent trajectories in EvoCode-Bench and identify requirement focus misalignment as a recurring failure pattern, where agents struggle to distinguish the primary modification targets of a requirement from unrelated code.

We propose RepoTrace, a requirement-driven repository understanding harness that combines repository structure with requirement semantics to construct a requirement-code correspondence and injects it into the agent context. This correspondence enables code agents to follow the repository architecture, trace requirements across multi-round interactions, and identify the core code elements corresponding to the current requirement. Experiments show that RepoTrace improves the mean per-round reward (MPR) across different models (e.g., +19.99 on GLM-5.2) and agent harnesses (e.g., +10.22 on Claude Code). Across rounds, RepoTrace increases the average per-round reward from 0.163 to 0.371 on Terminus-2 with DeepSeek-V4-Pro, while reducing average regression errors by 56.78%. We release the source code and agents' trajectories to support future research 1^{1}.

1 INTRODUCTION

Recently, code agents have become increasingly capable of performing software engineering tasks through interaction with software environments (Anthropic, 2026; OpenAI, 2026). A harness enables code agents to observe the environment, use tools, execute actions, receive execution feedback, and update memory (Sumers et al., 2024). Through multi-round interaction with the environment, code agents have demonstrated strong capabilities in repository-level code generation, vulnerability discovery, and software testing (Anthropic, 2026; Carlini et al., 2026; Maaz et al., 2026). Vibe coding shifts software development from one-shot code generation to iterative modification of existing software systems (Tang et al., 2026), where software maintenance and evolution are also important parts of the software life cycle (Lehman, 1980; Lientz et al., 1978). Future software development requires agents not only to satisfy current user requirements, but also to understand the architecture of existing repositories and the potential impact of their modifications.

However, recent studies show that code agents tend to degrade as the number of interaction rounds increases in complex multi-round software engineering tasks (Shen et al., 2026; Huang et al., 2026; Orlanski et al., 2026; Laban et al., 2025). For example, EvoCode-Bench (Shen et al., 2026) contains 26 stateful tasks and 227 interaction rounds from 12 mainstream code agents. The analysis of failure cases shows that the test pass rate decreases from 46.7% in early rounds to 7.7% in later rounds. Regression Accumulation (Huang et al., 2026) evaluates 542 tasks over 8 rounds, covering 26,016

∗^{*}Corresponding author.

1^{1}https://github.com/gtxygyzb/RepoTrace interaction instances, and reports that 40%–73% of tasks lose previously satisfied behaviors during multi-round interactions.

Software has two fundamental properties: constructivity and evolvability (Yang, 2005; Breivold et al., 2012). Constructivity refers to building software systems that satisfy functional goals based on requirements. Evolvability refers to the ability of software systems to iteratively adapt to changes in requirements, environments, and technologies while maintaining system integrity and consistency. The challenges introduced by software evolvability receive more and more attention, including architecture maintenance and dependency management (Gu et al., 2026). Recent studies have explored self-evolving software and recursive self-improvement (RSI), further demonstrating the importance of evolvability (Zhang et al., 2026; Liu et al., 2026a; Zhou, 2026).

To further understand the challenges faced by code agents during multi-round interactions, we systematically analyze 2,656 agent trajectories from EvoCode-Bench. We identify requirement focus misalignment as a recurring failure pattern. Specifically, code agents struggle to distinguish the primary modification targets of a requirement from related code elements (e.g., classes, functions, and files) that do not require direct modification. As a result, code agents may modify unrelated code or miss necessary synchronized updates. Across failure rounds, 55.16% of code modifications occur outside the modification target files specified by the human oracle (see Section 2).

To this end, we propose RepoTrace, a requirement-driven repository understanding harness that improves requirement tracing for code agents in multi-round software tasks. The core idea of RepoTrace is to explicitly guide code agents to establish the correspondence between requirements and the code repository before code modification. Specifically, RepoTrace first builds a structural representation of the code repository from code relations and computes a structural weight for each code element. The weights help identify core elements, extension points, and change propagation across the repository. Next, RepoTrace extracts the potential modification scope from the semantics of the natural-language requirement. Finally, RepoTrace combines requirement semantics with repository structure to construct a requirement-code correspondence and injects it into the agent context. RepoTrace allows code agents to trace the repository architecture across rounds and identify the core code elements corresponding to the current requirements.

We apply RepoTrace to multiple mainstream code agents and conduct experiments on multi-round software tasks. Experimental results show that: ① Across models, RepoTrace improves the mean per-round reward (MPR) by +19.99 on GLM-5.2 and +4.91 on MiniMax-M3. ② Across harnesses, RepoTrace improves MPR by +22.25 on Terminus-2 and +10.22 on Claude Code. ③ Across rounds, RepoTrace increases the average per-round reward from 0.163 to 0.371 on Terminus-2 with DeepSeek-V4-Pro, while reducing average regression errors by 56.78%. The main contributions are summarized as follows:

  1. We analyze agent trajectories and identify requirement focus misalignment as a recurring failure pattern during multi-round interactions.

  2. We propose RepoTrace, a requirement-driven repository understanding harness that combines repository structure and requirement semantics to improve requirement tracing for agents.

  3. Experimental results show that RepoTrace improves performance across models and harnesses in multi-round interactions, and reduces regression errors.

References (50)