Source: arXiv — 2026-08-14
Summary
AgentRewind is a runtime for long-horizon LLM agents that records aligned checkpoints of both the agent's context and the environment's state together, so an agent that fails partway through a task can roll back to an earlier checkpoint and resume — carrying forward what it learned from the failed attempt — instead of either preventing errors upfront or restarting the whole task from scratch. The paper introduces a new benchmark, MettleBench, built specifically to evaluate partial-progress recovery on long-horizon engineering tasks. AgentRewind is shown to improve task success rate and checklist progress across multiple different models and agent harnesses, making it a harness-agnostic technique rather than something tied to one specific agent framework.
Key Takeaways
- The framing shift is the core idea: instead of only trying to prevent agent errors upfront, treat failure as expected and make recovery from it cheap and informed.
- Checkpoints capture agent context and environment state together and aligned — not just a memory snapshot, and not just a filesystem snapshot, but both in sync so a rollback restores a coherent combined state.
- On failure, the agent rolls back to an earlier checkpoint rather than restarting from zero — and crucially, it keeps what it learned from the failed path instead of discarding that information.
- MettleBench is a new benchmark purpose-built to measure partial-progress recovery on long-horizon engineering tasks, filling a gap where existing benchmarks mostly measure end-to-end success/failure, not partial credit or recovery quality.
- Reported gains in task success rate and checklist progress hold across multiple different models and multiple different agent harnesses, indicating the technique is a general runtime layer rather than a framework-specific trick.
Reel Script
Hook: When a long-running coding agent fails three-quarters of the way through a task, today's tools do one of two things: either they try to stop the failure before it happens, or they just throw away everything and start the whole task over from step one. Both waste the work the agent already did.
Core Concept: Long-horizon agents — the kind doing multi-hour engineering tasks with dozens of steps — fail constantly along the way, and the standard playbook has been prevention: better prompts, better guardrails, catch the error before it happens. AgentRewind flips that. It assumes failure is normal and focuses on making recovery cheap instead. The mechanism is a checkpoint system, but the key detail is what gets checkpointed together: not just the agent's conversational context — what it's tried, what it's concluded — but the actual environment state, like files on disk or a running process, captured at the same aligned moment. That pairing matters because a checkpoint of just the agent's memory without the matching real-world state is useless — you'd resume the agent's reasoning against an environment that no longer matches what it remembers. When the agent hits a failure, AgentRewind rolls both back together to an earlier aligned checkpoint. But it doesn't roll back to amnesia — the agent resumes carrying forward what it learned from the failed attempt, so the second try isn't blind, it's informed by exactly what went wrong last time.
Hands-On: Picture a timeline you can draw left to right. First, checkpoints get laid down at intervals as the agent works — each one a paired snapshot of agent context plus environment state, in sync. Then failure hits partway through the task. Today's default response is one of two arrows: either jump all the way back to the start (full restart, all progress lost), or nothing at all if the failure wasn't caught upfront. AgentRewind draws a third arrow instead: a short hop back to the nearest good checkpoint, followed by a resume arrow forward that's now informed by the failed attempt's lesson, not blind. The authors built MettleBench specifically because existing benchmarks don't measure this well — they mostly score whether a task fully succeeded or fully failed, not how much partial progress survived a setback or how well an agent recovers from one. Tested across several different models and agent harnesses, AgentRewind improved both raw task success rate and progress against a task checklist, which is the evidence that this is a general-purpose runtime layer, not a hack tuned to one specific agent stack.
Takeaway: If you're building or running long-horizon agents, the real lesson isn't "add checkpoints" — it's that recovery deserves as much engineering attention as prevention, because at multi-hour task lengths, some failures are simply unavoidable. Go look at whether your own agent harness discards state on failure, and if it does, that's the first thing worth fixing.