代理系統/可觀測性
TrajDebug Tracks the Lifecycle of Agent Errors, With Failure Diagnosis Improving Rerun Success Rates by 10.8% on Average
TrajDebug does not treat the first error in an agent trajectory as the root cause. Instead, it tracks whether errors are repaired, whether they leave an impact on the final outcome, and how much recovery budget they consume. In tests on 486 human-annotated trajectories, converting diagnoses into prompts improved the success rate of rerunning the same tasks by 10.8% on average.

Researchers from Tsinghua University and Tencent Hunyuan have introduced TrajDebug to address one of the most difficult debugging problems for long-horizon agents: a failed run may contain multiple local errors, but the earliest, latest, or most conspicuous error is not necessarily the key cause of task failure. In a sample of 50 failed trajectories, the team identified 381 local errors, averaging 7.62 per trajectory. Excluding the actual critical errors, 61.9% were later corrected by the agent, while another 6.6% remained uncorrected but did not affect subsequent decisions.
TrajDebug first organizes trajectories into three levels of detail: high, medium, and low. The current step retains the original instructions, actions, and observations, while more distant history is progressively compressed. The system then identifies “erroneous commitments” that conflict with task rules, historical information, environment responses, or reasoning within the same step. Both the erroneous content and the violated evidence must be locatable verbatim. Related trigger points are grouped according to shared rules or observations, preventing repeated manifestations of the same error during planning, action, and verification from being counted multiple times.
In the second stage, errors are classified into four states: cleanly repaired, expensively repaired, still visibly consequential, or still present but without impact on the final outcome. If a repair consumes more than half the trajectory’s length, it is considered to leave “budget debt.” Only expensively repaired errors and errors that still affect the final outcome proceed to the final causal-attribution stage. The newly created TrajErrBench contains 400 τ²-Bench customer-service tool-use trajectories and 86 SWE-Bench Pro software-engineering trajectories, with the latter averaging 119.7 steps. Agreement among three annotators on critical steps reached Fleiss’ κ values of 0.91 and 0.67 for the two subsets, respectively.
The authors report that converting the diagnosis of a single failure into targeted guidance improved the success rate of rerunning the same task by 10.8% on average. Aggregating a small number of historical diagnoses into failure memory and applying it to unseen tasks produced an average improvement of 5.7%. This suggests that TrajDebug could serve as a root-cause analysis layer for agent observability platforms, rather than merely as an offline evaluator. However, final attribution still depends on LLM judgment, and the reported gains come from the authors’ own rerun setup. Although the GitHub repository already contains a directory structure and documentation, the code and data remain under internal review and cannot yet be independently reproduced.