Large language models (LLMs) exhibit strong performance on self-contained programming tasks. However, they still struggle with repository-level software engineering (SWE), which demands (1) deep codebase navigation with effective context management for accurate localization, and (2) systematic approaches for iterative, test-driven code modification to resolve issues. To address these challenges, we propose SWE-Adept, an LLM-based two-agent framework where a localization agent identifies issue-relevant code locations and a resolution agent implements the corresponding fixes. For issue localization, we introduce agent-directed depth-first search that selectively traverses code dependencies. This minimizes issue-irrelevant content in the agent's context window and improves localization accuracy. For issue resolution, we employ adaptive planning and structured problem solving. We equip the agent with specialized tools for progress tracking and Git-based version control. These tools interface with a shared working memory that stores code-state checkpoints indexed by execution steps, facilitating precise checkpoint retrieval. This design enables reliable agent-driven version-control operations for systematic issue resolution, including branching to explore alternative solutions and reverting failed edits. Experiments on SWE-Bench Lite and SWE-Bench Pro demonstrate that SWE-Adept consistently outperforms prior approaches in both issue localization and resolution, improving the end-to-end resolve rate by up to 4.3%.
翻译:大语言模型(LLMs)在自包含编程任务中表现出色,但在仓库级软件工程(SWE)任务中仍面临挑战。此类任务要求:(1)深度代码库导航与有效上下文管理以实现精准定位,(2)采用系统性方法进行迭代式测试驱动的代码修改以解决问题。为应对这些挑战,我们提出SWE-Adept框架——一种基于LLM的双智能体架构,其中定位智能体负责识别与问题相关的代码位置,解决智能体则实施相应修复。针对问题定位,我们引入了智能体引导的深度优先搜索方法,该方法选择性遍历代码依赖关系,最大限度减少智能体上下文窗口中与问题无关的内容,从而提升定位精度。针对问题解决,我们采用自适应规划与结构化问题求解策略。我们为智能体配备专用工具以实现进度追踪和基于Git的版本控制,这些工具通过共享工作记忆交互,该工作记忆存储按执行步骤索引的代码状态检查点,便于精确检索检查点。该设计使智能体驱动的版本控制操作具备可靠性,可实现系统性问题解决,包括分支探索替代解决方案与回滚失败编辑。在SWE-Bench Lite和SWE-Bench Pro上的实验表明,SWE-Adept在问题定位与解决方面持续优于现有方法,端到端解决率最高提升4.3%。