arXiv:2603.05744cs.CLcs.SE2026-03ACL被引 7

通过分析代码库提前优化模糊编程请求,提升AI助手的修复成功率。

CodeScout: Contextual Problem Statement Enhancement for Software Agents

  • 先扫描代码库,从多角度分析潜在修复方案和探索路径。
  • 使问题描述更完整,解决率提升20%,多修复27个任务。
  • 适合想提高AI编程助手效率的开发者与研究者使用。

当前AI编程辅助工具常因问题描述不清而失败,尤其在缺乏足够上下文和需求说明时,导致代理出现过度探索或重复尝试同一修复策略,轨迹发散且结果不佳。本文提出CodeScout,一种轻量级的上下文查询优化方法,在执行任务前对目标代码库进行预探索,将模糊请求转化为完整、可操作的问题陈述。其核心创新在于:无需修改现有代理架构,仅通过结构化前置分析即可增强代理能力。CodeScout执行定向上下文定位,开展多视角分析以识别可能修复方案与探索机会,并整合为包含复现步骤、预期行为及针对性探索提示的增强型问题描述。该预探索有效减少非收敛轨迹,明确用户自然语言意图。在SWEBench-Verified数据集上,结合先进代理框架与语言模型评估,相比默认基线方法,解决率提升20%,最多额外解决27个问题。结果表明,基于上下文分析的系统性查询优化,是提升AI编程辅助能力的重要方向。

原文摘要 · Abstract (English)

Current AI-powered code assistance tools often struggle with poorly-defined problem statements that lack sufficient task context and requirements specification. Recent analysis of software engineering agents reveals that failures on such underspecified requests are highly correlated with longer trajectories involving either over-exploration or repeated attempts at applying the same fix without proper evolution or testing, leading to suboptimal outcomes across software development tasks. We introduce CodeScout, a contextual query refinement approach that systematically converts underspecified user requests into comprehensive, actionable problem statements through lightweight pre-exploration of the target codebase. Our key innovation is demonstrating that structured analysis before task execution can supplement existing agentic capabilities without requiring any modifications to their underlying scaffolds. CodeScout performs targeted context scoping, conducts multi-perspective analysis examining potential fixes and exploration opportunities, then synthesizes these insights into enhanced problem statements with reproduction steps, expected behaviors, and targeted exploration hints. This pre-exploration directly addresses the identified failure patterns by reducing non-converging agent trajectories while clarifying user intent in natural language space. We evaluate CodeScout using state-of-the-art agentic scaffolds and language models on SWEBench-Verified, demonstrating a 20\% improvement in resolution rates with up to 27 additional issues resolved compared to the default baseline method. Our results suggest that systematic query refinement through contextual analysis represents a promising direction for enhancing AI code assistance capabilities.

AI编程代码生成智能助手上下文理解

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。