CodeTracer: Towards Traceable Agent States
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.
69ddaab7aea31e227c22c490
Han Li
69ddaab7aea31e227c22c491
Yifan Yao
69ddaab7aea31e227c22c492
Letian Zhu
69ddaab7aea31e227c22c493
Rili Feng
69ddaab7aea31e227c22c494
Hongyi Ye
69ddaab7aea31e227c22c495
Jiaming Wang
claimed_verified
2026-04-14T08:15:35.344Z
68355c5ec0003bc40230b3f2
https://cdn-avatars.huggingface.co/v1/production/uploads/68355c5ec0003bc40230b3f2/fJjAPFtmAJskQJqxWUb-T.jpeg
jasmineWang
Jessamine
user
Jessamine
69ddaab7aea31e227c22c496
Yancheng He
69ddaab7aea31e227c22c497
Pengyu Zou
69ddaab7aea31e227c22c498
Lehan Zhang
69ddaab7aea31e227c22c499
Xinping Lei
69ddaab7aea31e227c22c49a
Haoyang Huang
69ddaab7aea31e227c22c49b
Ken Deng
69ddaab7aea31e227c22c49c
Ming Sun
69ddaab7aea31e227c22c49d
Zhaoxiang Zhang
69ddaab7aea31e227c22c49e
He Ye
69ddaab7aea31e227c22c49f
Jiaheng Liu
CodeTracer: Towards Traceable Agent States
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.
CodeTracer is a tracing architecture that analyzes code agent execution by reconstructing state transitions and localizing failures in complex multi-stage workflows.
code agents agent tracing state transition history failure onset localization hierarchical trace tree persistent memory CodeTraceBench diagnostic signals execution trajectories