Minimal Execution Patches for Causal Debugging of Tool-Using Agents
Abstract
Tool-using language agents often fail because one intermediate action corrupts the downstream execution state, yet standard benchmark evaluation usually reveals only the final reward and a raw trajectory trace. We propose execution intervention for post-hoc debugging: a methodology that treats failed agent trajectories as replayable programs. Given a failed run with checkpointed environment state, the method restores an intermediate snapshot, applies a small structured patch, replays execution, and checks whether the benchmark outcome flips from failure to success. The smallest successful intervention is useful both as a repair and as a causal autopsy of the root failure. We instantiate this protocol on real tau-style environments with deterministic state, saved benchmark trajectories, and benchmark-native evaluators. The current system supports structured patch families, bounded search-cost accounting, strict versus oracle continuation analysis, and explicit rerun baselines including retry from scratch and retry from a localized snapshot. On controlled synthetic failures, the prototype supports exact localization metrics in addition to recovery. On imported natural failures, the current artifact-backed evidence already includes strict non-oracle recoveries in both retail and airline settings, including continuation-based recovery after an identity-lookup repair and deletion-based recovery for harmful mutating actions. The frozen workshop corpus now contains 80 replay-failing natural cases and 24 controlled synthetic failures across retail and airline. On the updated workshop artifacts, structured strict replay recovers 27/80 natural failures, the oracle upper bound reaches 35/80, and the strongest simple retry baseline recovers 15/80 natural failures. On the synthetic corpus, heuristic localization recovers 24/24 with perfect top-1 localization. These results motivate replayable execution intervention as a practical debugging protocol for LLM agents: more causal than prompt-only retry, more interpretable than unconstrained regeneration, and naturally aligned with benchmark evaluation.