Agent Reliability & Debugging: Step-Level Fault Localization, Trajectory Uncertainty Estimation, and Failure-to-Fix Flywheels
Why a $95\%$ per-step accuracy degrades to $0.95^8 = 66.3\%$ across an 8-step agent trajectory, how to isolate the exact step $t^*$ and tool invocation $a_{t^*}$ where a multi-step agent run went wrong using OpenTelemetry DAG spans and counterfactual prefix replay, how to quantify step-level uncertainty via token log-probabilities and semantic entropy, and how we debugged and hardened “Aria” at VogueCart to drive +58.86% engaged MAU and +31.74% repeat usage.
In a multi-step agent, failures rarely announce themselves at the step where they actually occur. When an e-commerce shopping assistant recommends an out-of-budget polyester gown to a user who asked for an olive linen midi dress under \$90, looking only at the final synthesizer prompt suggests a generation hallucination. In reality, the failure happened two steps earlier when a tool call serialized an overly strict attribute filter (color="olive_drab"), received $0$ catalog hits, and triggered a naive fallback that wiped the user’s budget and fabric constraints.
Two chapters on debugging and hardening multi-step agents
Instrument agent execution DAGs with OpenTelemetry span invariants, isolate the decisive failure step $t^*$ in $\mathcal{O}(\log_2 T)$ replays via counterfactual prefix bisection, walk through the 4-part failure taxonomy of “Aria” at VogueCart, and engineer deterministic progressive filter relaxation and session slot ledgers.
Estimate step-level and trajectory-level uncertainty using token log-probability entropy over JSON tool arguments, Kuhn et al.’s Semantic Entropy across $K$ rollouts, and calibrated abstention/clarification thresholds, then build an automated flywheel that clusters production failure traces into Pydantic schema guards and locked CI regression tests.