隐藏于显而易见之处:关于编码智能体的指令栈的实证研究
Hidden in Plain Sight: an Empirical Study about The Instruction Stacks of Coding Agents
AI总结:
本研究通过对5款编码智能体1886个版本的指令栈开展纵向跨智能体研究,揭示了指令栈的构成演变及存在的记录不足问题,为智能体设计研究提供了新的参考。
摘要:
编码智能体向其模型发送的内容不止用户的提示:它们会添加指令、工具定义和环境上下文,这些内容共同构成了指令栈。该指令栈指导执行过程,且会随版本更新而变化,但对用户而言基本未被公开,在研究中也未得到充分表征。我们针对Claude Code、Codex、Gemini CLI、Qwen Code和OpenCode这5款智能体的1886个版本的首次模型请求中捕获的指令栈,开展了一项纵向跨智能体研究。在受控条件下,我们分析了这些指令栈的构成与演变,并追溯了4款开源智能体的变化与已记录动机的关联。我们的研究结果表明,仅检查系统提示或单独报告模型,无法完整呈现智能体的输入情况。工具定义在3款智能体的最新请求中占主导地位,而偶尔出现的集中修订会改变管控工具使用、属性归属和编码风格的指令。此类修订可能会使研究人员识别智能体生成的贡献以及解释生成代码的过程变得复杂。我们还发现,在被检查的变更单元中,仅有48%的单元能直接解释指令栈修订的动机。尽管不同智能体的措辞日益不同,但它们仍呈现出共享的能力。这些研究结果揭示了智能体设计中一个不断演变且未被完整记录的层面。这些发现促使人们在发布智能体、模型和用户提示的同时,记录捕获的指令栈,并保留其修订背后的原理。
英文摘要:
Coding agents send their models more than the user's prompt: they add instructions, tool definitions, and environmental context that form an instruction stack. This stack guides execution and changes across releases, yet remains largely unexposed to users and insufficiently characterized in research. We present a longitudinal, cross-agent study of the instruction stacks captured in the first model requests of 1,886 releases of Claude Code, Codex, Gemini CLI, Qwen Code, and OpenCode. Under controlled conditions, we analyze their composition and evolution and trace changes in the four open-source agents to documented motivations. Our findings show why examining the system prompt or reporting the model alone provides an incomplete account of agent inputs. Tool definitions dominate three agents' latest requests, while occasional concentrated revisions alter instructions governing tool use, attribution, and coding style. Such revisions can complicate how researchers identify agent-authored contributions and interpret generated code. We also found that only 48% of examined change units directly explain the motivation for stack revisions. Across agents, shared capabilities emerge despite increasingly distinct wording. These findings expose an evolving, incompletely documented layer of agent design. The findings motivate documenting captured instruction stacks alongside agent releases, models, and user prompts, and preserving the rationale behind their revisions.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。