# Failure replay

Failure replay is the practice of reproducing a production failure with its full original context,
so that a proposed fix can be verified against the case that actually happened.

It exists because agent failures are context-dependent. A failure comes from a specific conversation
history, a specific set of tool results, and specific state. The same prompt with a paraphrased
message or slightly different state will often behave differently, so a fix checked against an
approximation of the failure can pass while the original case still fails.

Replaying a failure means capturing enough of the trace to re-run the failing turn faithfully: the
message history the model saw, the tool outputs as they were returned at the time, and the
configuration that was active. Tool outputs have to be recorded because the live systems behind them
change state, and a later call would return different results. With that context preserved, a
proposed fix runs against the real failing case, so its verdict reflects the actual failure.

The captured case also outlives the fix. Once a failure is reproducible, it can join an eval set as
a regression case, so the same failure class is checked on every future change. This gives replay a
second role beyond debugging: the record built to understand one failure becomes a standing check
for its recurrence.

## Questions answered under this concept

- [How do I replay a failed agent session turn by turn?](https://tessary.ai/answers/failure-replay/how-do-i-replay-a-failed-agent-session-turn-by-turn)
- [What can replay not tell me?](https://tessary.ai/answers/failure-replay/what-can-replay-not-tell-me)
- [What does replay show that a trace viewer does not?](https://tessary.ai/answers/failure-replay/what-does-replay-show-that-a-trace-viewer-does-not)
- [Why can't I just reproduce the failure locally?](https://tessary.ai/answers/failure-replay/why-cant-i-just-reproduce-the-failure-locally)
- [Why do tool outputs need to be captured instead of called again live?](https://tessary.ai/answers/failure-replay/why-do-tool-outputs-need-to-be-captured-instead-of-called-again-live)
- [Why does a fixed agent bug come back weeks later?](https://tessary.ai/answers/failure-replay/why-does-a-fixed-agent-bug-come-back-weeks-later)

---

Source: https://tessary.ai/answers/failure-replay
All concepts: https://tessary.ai/answers
From Tessary, agent reliability for AI agents in production: https://tessary.ai
