Structured recovery improves fixes in long task stateful language agents
From Trace to Fix: Residual Task State in Long-Horizon Agents
Artificial Intelligence
Summary
Fixing problems in long, complicated tasks that use language-based agents is tricky because the cause of the problem, its symptoms, and the part that needs fixing often don’t match up. The authors developed TRACE-FIX, a system that turns detailed logs into structured records to track what still needs to be done, not just obvious errors. They also created a method to plan repairs carefully within a limited budget to avoid wasting effort. Their tests show this helps find and fix issues more reliably without guessing blindly.
What this means in practice
- •For software engineers: Recover complex automated language tasks more reliably by tracing failures to their root causes and planning targeted repairs within resource limits.
- •For devops teams: Improve automated system debugging by structuring execution logs into dependency chains, enabling better failure diagnosis and controlled fix attempts.
Authors
Zile Huang, Ser-nam Lim
Abstract
Recovering from failures in long-horizon, stateful language agents is challenging because the action introducing a defect, the symptom exposing it, and the persistent state requiring repair frequently diverge. Existing methods largely focus on retrospective failure attribution, leaving sequential diagnosis and state repair poorly integrated under constrained budgets. We introduce TRACE-FIX, a unified recovery framework centered on versioned residual task state. Trace transforms execution logs into a structured dependency-linked ledger, prioritizing unresolved task requirements rather than salient surface errors. Fix formulates recovery as budgeted planning over admissible actions, incorporating outcome forecasting and explicit repair-reserve constraints to prevent premature budget exhaustion. To rigorously decouple localization accuracy from downstream repair capability, we present LongH-Debug, evaluating root-cause attribution, verified-fault recovery, and end-to-end closed-loop execution independently. Our empirical analysis demonstrates that structured residual tracking substantially improves causal localization over raw-trace baselines, while budget-aware sequential planning converts verified fault signals into more reliable task recovery without destructive trial-and-error. Code is available at https://github.com/toffeecat/tracedp.