arXiv:2604.03515cs.SEcs.AI2026-04被引 13

剖析13个开源编程智能体的底层代码结构,揭示其设计模式与核心差异。

Inside the Scaffold: A Source-Code Taxonomy of Coding Agent Architectures

  • 基于源码分析构建三层12维架构分类体系
  • 发现控制策略从固定流水线到蒙特卡洛树搜索不等,工具数量0至37个
  • 提出五种可组合的循环原语,适用于智能体设计与行为研究

基于大语言模型的编程智能体可在极少人工干预下定位错误、生成修复方案并运行测试,但围绕语言模型的支撑代码(如控制循环、工具定义、状态管理、上下文策略)仍缺乏深入理解。现有综述仅按抽象能力(工具使用、规划、反思)分类,无法区分实际架构差异;轨迹研究虽观察行为,却未分析决定行为的底层代码。本文通过对13个开源编程智能体在特定提交版本下的源码分析,构建了包含三个层级共12个维度的架构分类体系:控制架构、工具与环境接口、资源管理。分析发现,支撑架构难以被离散分类:控制策略涵盖固定流水线至蒙特卡洛树搜索,工具数量从0到37不等,上下文压缩采用七种不同策略。五种循环原语(ReAct、generate-test-repair、plan-execute、multi-attempt retry、tree search)作为可组合构件,11个智能体均采用多种原语组合而非单一结构。在外部约束主导的领域(如工具能力类别、编辑格式、执行隔离)维度趋于收敛,在开放设计问题区域(如上下文压缩、状态管理、多模型路由)则呈现多样性。所有结论均基于文件路径与行号,为研究智能体行为和设计新架构提供可复用参考。

原文摘要 · Abstract (English)

LLM-based coding agents can localize bugs, generate patches, and run tests with diminishing human oversight, yet the scaffolding code that surrounds the language model (the control loop, tool definitions, state management, and context strategy) remains poorly understood. Existing surveys classify agents by abstract capabilities (tool use, planning, reflection) that cannot distinguish between architecturally distinct systems, and trajectory studies observe what agents do without examining the scaffold code that determines why. This paper presents a source-code-level architectural taxonomy derived from analysis of 13 open-source coding agent scaffolds at pinned commit hashes. Each agent is characterized across 12 dimensions organized into three layers: control architecture, tool and environment interface, and resource management. The analysis reveals that scaffold architectures resist discrete classification: control strategies range from fixed pipelines to Monte Carlo Tree Search, tool counts range from 0 to 37, and context compaction spans seven distinct strategies. Five loop primitives (ReAct, generate-test-repair, plan-execute, multi-attempt retry, tree search) function as composable building blocks that agents layer in different combinations; 11 of 13 agents compose multiple primitives rather than relying on a single control structure. Dimensions converge where external constraints dominate (tool capability categories, edit formats, execution isolation) and diverge where open design questions remain (context compaction, state management, multi-model routing). All taxonomic claims are grounded in file paths and line numbers, providing a reusable reference for researchers studying agent behavior and practitioners designing new scaffolds.

智能体架构源码分析编程助手分类体系

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