Modern code intelligence agents operate in contexts exceeding 1 million tokens--far beyond the scale where humans manually locate relevant files. Yet agents consistently fail to discover architecturally critical files when solving real-world coding tasks. We identify the Navigation Paradox: agents perform poorly not due to context limits, but because navigation and retrieval are fundamentally distinct problems. Through 258 automated trials across 30 benchmark tasks on a production FastAPI repository, we demonstrate that graph-based structural navigation via CodeCompass--a Model Context Protocol server exposing dependency graphs--achieves 99.4% task completion on hidden-dependency tasks, a 23.2 percentage-point improvement over vanilla agents (76.2%) and 21.2 points over BM25 retrieval (78.2%).However, we uncover a critical adoption gap: 58% of trials with graph access made zero tool calls, and agents required explicit prompt engineering to adopt the tool consistently. Our findings reveal that the bottleneck is not tool availability but behavioral alignment--agents must be explicitly guided to leverage structural context over lexical heuristics. We contribute: (1) a task taxonomy distinguishing semantic-search, structural, and hidden-dependency scenarios; (2) empirical evidence that graph navigation outperforms retrieval when dependencies lack lexical overlap; and (3) open-source infrastructure for reproducible evaluation of navigation tools.
翻译:现代代码智能体在超过100万标记的上下文中运行——远超人类手动定位相关文件的规模。然而,在解决实际编码任务时,智能体始终无法发现架构关键文件。我们识别出导航悖论:智能体表现不佳并非由于上下文限制,而是因为导航与检索本质上是不同的问题。通过对一个生产级FastAPI仓库的30个基准任务进行258次自动化试验,我们证明基于图的结构化导航(通过CodeCompass实现——一个暴露依赖图的模型上下文协议服务器)在隐藏依赖任务上实现了99.4%的任务完成率,相较于原始智能体(76.2%)提升了23.2个百分点,相较于BM25检索(78.2%)提升了21.2个百分点。然而,我们发现了一个关键的采纳鸿沟:58%具有图访问权限的试验未进行任何工具调用,智能体需要明确的提示工程才能持续采用该工具。我们的研究结果表明,瓶颈并非工具可用性,而是行为对齐——必须明确引导智能体利用结构化上下文而非词汇启发式方法。我们的贡献包括:(1)区分语义搜索、结构化和隐藏依赖场景的任务分类法;(2)经验证据表明当依赖关系缺乏词汇重叠时,图导航优于检索;(3)用于可复现评估导航工具的开源基础设施。