Code agents are currently having skillful performance on repository-level software engineering benchmarks, but it remains unclear whether success on end-to-end tasks such as issue resolution truly reflects repository context reasoning, the ability to identify the task-relevant information across multiple files and reason over the relations among them. To investigate this question, we introduce RepoMirage, a two-stage evaluation suite built on SWE-Bench Verified that adopts perturbation as a diagnostic tool to increase the demand for context reasoning by transforming how the repository is exposed. First, RepoMirage-Perturb applies three types of semantics-preserving repository-level perturbations, revealing a clear performance drop when correct solving requires broader context access. RepoMirage-Extend further turns perturbation-targeted structural bottlenecks into explicit tasks beyond issue resolution, where the average performance declines from 66.8% in the original setting to 25.3%, indicating a significant deficiency in repository context reasoning. Further trajectory analysis reveals an exploration drift, where agents access broader repository context but fail to turn it into effective structure information. Motivated by this observation, we propose RepoAnchor, a structure-first prototype workflow that separates repository exploration from downstream problem solving, and show that explicit structural scaffolding yields notable gains. These results uncover an previously overlooked gap in repository context reasoning for code agents and suggest that stronger structure-aware methods are potential to improve them.
翻译:[翻译摘要] 当前代码智能体在仓库级软件工程基准测试中表现优异,但尚不清楚在诸如问题解决等端到端任务上的成功是否真正反映了其仓库上下文推理能力——即跨多个文件识别任务相关信息并推理其间关系的能力。为探究此问题,我们提出RepoMirage,一个基于SWE-Bench Verified构建的两阶段评估套件,该套件采用扰动作为诊断工具,通过改变仓库的暴露方式来增加对上下文推理的需求。首先,RepoMirage-Perturb应用三种保持语义的仓库级扰动,结果表明当正确求解需要更广泛的上下文访问时,性能显著下降。RepoMirage-Extend进一步将扰动针对的结构瓶颈转化为超越问题解决的显式任务,在此场景下平均性能从原始设置的66.8%降至25.3%,揭示了仓库上下文推理能力的显著缺陷。进一步的轨迹分析表明存在探索漂移现象:智能体访问更广泛的仓库上下文却未能将其转化为有效的结构化信息。受此启发,我们提出RepoAnchor,一种结构优先的原型工作流,将仓库探索与下游问题求解相分离,并证明显式结构化支撑可带来显著性能提升。这些结果揭示了代码智能体在仓库上下文推理中此前被忽视的差距,并表明更强的结构感知方法有望改进此类模型。