Failure as a Process: An Anatomy of CLI Coding Agent Trajectories

📄 arXiv: 2607.09510v1 📥 PDF

作者: Xiangxin Zhao, Han Li, Shuaiting Li, Tianyi Zhao, Earl T. Barr, Federica Sarro, He Ye

分类: cs.SE, cs.AI

发布日期: 2026-07-10

备注: 12 pages, 6 figures


💡 一句话要点

提出过程导向框架分析CLI编码代理失败轨迹

🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)

关键词: 大型语言模型 编码代理 失败分析 过程导向 软件工程 自动化工具

📋 核心要点

  1. 现有研究将编码代理的失败视为最终结果,缺乏对失败过程的动态分析,限制了对失败原因的深入理解。
  2. 本文提出了一种过程导向的框架,分析编码代理在执行过程中的失败轨迹,包括失败的发生、演变和恢复。
  3. 通过对1,794条有效执行轨迹的分析,发现失败主要由认知错误引起,且通常在执行初期就开始显现,恢复困难。

📝 摘要(中文)

随着大型语言模型(LLM)编码代理在终端环境中自主执行软件工程任务的应用日益增多,其可靠性问题也愈发引起关注。现有研究主要将失败视为最终结果,缺乏对失败过程的深入分析。本文首次进行大规模实证研究,提出一种过程导向框架,分析编码代理在执行过程中的失败发生、演变及恢复情况。我们收集了3,843条执行轨迹,并筛选出1,794条完整有效的轨迹进行手动标注,发现编码代理的失败主要由认知错误驱动,通常在执行的最初几步就开始,并且在恢复不再可能时才显现出来。这表明,提高编码代理的可靠性需要更早的验证和干预,而不仅仅依赖最终结果的评估。

🔬 方法详解

问题定义:本文旨在解决现有研究对编码代理失败的静态分析问题,缺乏对失败过程的动态理解,导致对失败根源的认识不足。

核心思路:提出一种过程导向的框架,通过分析失败的发生、演变和恢复,深入理解编码代理的失败轨迹,以便于早期干预和改进。

技术框架:研究首先收集了3,843条执行轨迹,经过筛选得到1,794条有效轨迹,采用手动标注的方法分析每条轨迹中的失败步骤和根本原因。

关键创新:本研究的创新点在于将失败视为一个动态过程,而非静态结果,揭示了失败的早期迹象和演变过程,为提高编码代理的可靠性提供了新的视角。

关键设计:在数据收集和标注过程中,研究团队设计了详细的标注标准,并对每条轨迹的执行步骤进行了系统分析,确保了数据的准确性和可靠性。

🖼️ 关键图片

fig_0
fig_1
fig_2

📊 实验亮点

实验结果表明,编码代理的失败主要由认知错误引起,且通常在执行的最初几步就开始显现。研究发现,63,000多个执行步骤中,超过63%的失败在恢复不再可能时才被识别,强调了早期验证的重要性。

🎯 应用场景

该研究的框架和发现可广泛应用于软件工程领域,特别是在自动化编码和调试工具的开发中。通过理解失败的动态过程,开发者可以设计出更可靠的编码代理,减少软件开发中的错误,提高生产效率。未来,该框架还可扩展至其他领域的智能系统,以提升其可靠性和用户体验。

📄 摘要(原文)

Large language model (LLM) coding agents are increasingly deployed to autonomously perform software engineering tasks in terminal-based environments, making their reliability a growing concern. Existing empirical studies investigate why coding agents fail, yet they largely treat failure as a final outcome rather than a temporal process, providing limited insight into how failures emerge, evolve, and become unrecoverable. We present the first large-scale empirical study of CLI coding-agent failure trajectories, introducing a process-oriented framework that analyzes failure through its onset, evolution, and recovery across execution trajectories. We first collect 3,843 execution trajectories generated by seven frontier models across three coding-agent scaffolds (OpenHands, MiniSWE, and Terminus2) on Terminal-Bench, then carefully filter them to obtain 1,794 complete and valid trajectories for manual annotation (over 63,000 execution steps), from which we derive 14 findings spanning failure occurrence, root causes, recovery, and cross-system consistency. Our findings show that coding-agent failures are predominantly driven by epistemic errors, typically begin within the first few execution steps, and often remain hidden until recovery is no longer possible, suggesting that improving coding-agent reliability requires earlier validation and intervention rather than relying solely on final-outcome evaluation.