arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2604.11641cs.SEcs.AI
收藏

CodeTracer:迈向可追溯的代理状态

CodeTracer: Towards Traceable Agent States

Nanjing University(南京大学);Kuaishou Technology(快手科技);Institute of Automation, CAS(中国科学院自动化研究所);University College London(伦敦大学学院);Renmin University of China(中国人民大学);Alibaba Group(阿里巴巴集团)
Han Li, Yifan Yao, Letian Zhu, Rili Feng, Hongyi Ye, Jiaming Wang, Yancheng He, Pengyu Zou, Lehan Zhang, Xinping Lei, Haoyang Huang, Ken Deng, Ming Sun, Zhaoxia… 展开作者

Han Li, Yifan Yao, Letian Zhu, Rili Feng, Hongyi Ye, Jiaming Wang, Yancheng He, Pengyu Zou, Lehan Zhang, Xinping Lei, Haoyang Huang, Ken Deng, Ming Sun, Zhaoxiang Zhang, He Ye, Jiaheng Liu

AI总结:

CodeTracer通过解析异构运行 artifacts,重建状态转换历史,并定位故障起始点,提升代理调试效率。

摘要:

Code agents正在快速进步,但调试变得愈发困难。随着框架协调并行工具调用和多阶段工作流,代理状态转换和错误传播难以观察。早期错误可能导致代理陷入无用循环或引发根本错误,形成隐藏的错误链。现有代理追踪分析要么关注简单交互,要么依赖小规模手动检查,限制了可扩展性和实际编码工作流的实用性。我们提出了CodeTracer,一种追踪架构,通过演进的提取器解析异构运行 artifacts,重建完整的状态转换历史作为层次化追踪树,并执行故障起始点定位以确定故障起源及其下游链。为系统评估,我们从四个广泛使用的代码代理框架在多样化代码任务(如bug修复、重构和终端交互)上生成的大量执行轨迹中构建CodeTraceBench,具有阶段和步骤层面的监督以实现故障定位。实验表明,CodeTracer显著优于直接提示和轻量级基线,并且回放其诊断信号在匹配预算下一致恢复原本失败的运行。我们的代码和数据已公开可用。

英文摘要:

Code agents are advancing rapidly, but debugging them is becoming increasingly difficult. As frameworks orchestrate parallel tool calls and multi-stage workflows over complex tasks, making the agent's state transitions and error propagation hard to observe. In these runs, an early misstep can trap the agent in unproductive loops or even cascade into fundamental errors, forming hidden error chains that make it hard to tell when the agent goes off track and why. Existing agent tracing analyses either focus on simple interaction or rely on small-scale manual inspection, which limits their scalability and usefulness for real coding workflows. We present CodeTracer, a tracing architecture that parses heterogeneous run artifacts through evolving extractors, reconstructs the full state transition history as a hierarchical trace tree with persistent memory, and performs failure onset localization to pinpoint the failure origin and its downstream chain. To enable systematic evaluation, we construct CodeTraceBench from a large collection of executed trajectories generated by four widely used code agent frameworks on diverse code tasks (e.g., bug fixing, refactoring, and terminal interaction), with supervision at both the stage and step levels for failure localization. Experiments show that CodeTracer substantially outperforms direct prompting and lightweight baselines, and that replaying its diagnostic signals consistently recovers originally failed runs under matched budgets. Our code and data are publicly available.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑