Crashed LLM Agent Recovery: Rich Conversation Snapshots vs VM Snapshots

When an autonomous LLM agent crashes mid-task due to OOM kills, framework panics, or host pressure, IBM Research (arXiv:2612.00477) proves that restoring a kilobyte-sized rich conversation snapshot paired with durable tool-result redelivery recovers 100% losslessly—matching uninterrupted baselines in pass rate, token count, and exact tool-call sequence. Restarting without history drops TauBench pass rate to 78% and inflates token spend by 22–25%.
Crashed LLM Agent Recovery: Rich Conversation Snapshots vs VM Snapshots: When an autonomous LLM agent crashes mid-task due to OOM kills, framework panics, or host pressure, IBM Research (arXiv:2612.00477) proves that restoring a kilobyte-sized rich conversation snapshot paired with durable tool-result redelivery recovers 100% losslessly—matching uninterrupted baselines in pass rate, token count, and exact tool-call sequence. Restarting without history drops TauBench pass rate to 78% and inflates token spend by 22–25%. Designed as a zero-dependency, open-source TypeScript architecture under the MIT License with native Model Context Protocol (MCP) support and deterministic phase state machines.
- 100% Lossless Trajectory Recovery: Rich conversation snapshots (including tool calls & tool results) matched uninterrupted baselines across 150 TauBench and 150 AppWorld crash runs.
- Prevents 22–35% Re-Work Penalty: Without snapshots, TauBench passes fell from 100% to 78% (74% at 75% crash depth) with +25.4% tokens and +31.8% extra LLM calls.
- Kilobytes vs Gigabytes: Rich transcripts preserve Specification state and externalized Work state in KBs/ms rather than GB/sec VM snapshots.
- Durable Redelivery Closes the Crash Window: Persisting tool outcomes at the orchestrator boundary before delivery prevents duplicate side-effect execution on resume.
import { createAgent } from '@smoke-monkey/harness';import fs from 'node:fs';// Persist rich conversation + tool-result checkpoints at every LLM call boundaryconst CHECKPOINT_PATH = './.smoke-monkey/session-snapshot.json';const resilientAgent = createAgent({agentId: 'crash-resilient-coder',provider: 'openai-compatible',model: 'google/gemma-4-26b-a4b',baseUrl: 'http://127.0.0.1:8080/v1',workspacePath: process.cwd(),permissions: {read_file: 'allow',write_file: 'allow',run_command: 'ask',},mcpServers: {filesystem: {command: 'npx',args: ['-y', '@modelcontextprotocol/server-filesystem', process.cwd()],},},});async function runWithDurableSnapshot(task: string) {const priorMessages = fs.existsSync(CHECKPOINT_PATH)? JSON.parse(fs.readFileSync(CHECKPOINT_PATH, 'utf8')): [];console.log(`Restoring ${priorMessages.length} persisted transcript turns...`);const result = await resilientAgent.run(task);fs.mkdirSync('./.smoke-monkey', { recursive: true });fs.writeFileSync(CHECKPOINT_PATH, JSON.stringify({ summary: result.summary }, null, 2));}runWithDurableSnapshot('Migrate DB schema and verify idempotent rollback scripts').catch(console.error);
Watch: Related Video Guides
I Built a Voice Agent That Handles Real Interruptions: LangGraph + Redis Checkpointing in Production
AI Explained: Checkpointing in LLMs and the Trade-Offs between Reliability and Performance
Specification, Work, and LLM State: Empirical Crash Benchmarks
IBM Research (arXiv:2612.00477) injected crashes at 25%, 50%, and 75% task depth across TauBench (multi-turn conversational tool use) and AppWorld (one-shot code directives) using deterministic Gemma-4-26B-A4B-it-Q8_0 on llama.cpp (2x A30 GPUs, 3x verified repetitions). Comparing a rich conversation snapshot (preserving user messages, assistant tool calls, and persisted tool results) against history-free restarts shows that lost dialogue—not external world mutations—causes almost all recovery failures.
| Benchmark & Metric | Rich Conversation Snapshot | No-Snapshot Restart | No-Snapshot Penalty (75% Depth) |
|---|---|---|---|
| TauBench Pass Rate (150 Runs) | `100%` | 78% | Drops from 84% (25%) to 74% (75%) |
| TauBench Token Delta | `0%` | +25.4% | Escalates from +17% to +35% |
| TauBench LLM Calls / Active Time | 0% / +0.1% | +31.8% / +23.2% | Lost dialogue forces user re-interrogation |
| AppWorld Pass Rate (150 Runs) | `100%` | 95% | Re-consumes ~108K tokens regardless of depth |
| AppWorld Token / LLM Call Delta | `0%` / `0%` | +22.1% / +37.7% | Redoes full discovery & auth work |
Why World Resets Fail and When VM Snapshots Actually Help
All 33 no-snapshot TauBench failures stemmed from lost dialogue (such as user negations, multi-step constraints, and already-resolved sub-issues); resetting the external database did not improve pass counts (79/90 with reset vs 80/90 without). Conversely, on baseline-failing tasks where an agent was stuck in a bad trajectory, discarding history accidentally rescued 8 of 15 TauBench and 5 of 19 AppWorld tasks.
Comparing snapshot mechanisms reveals a clean boundary:
- Rich Conversation Snapshot (KB / ms): Preserves Specification state and externalized Work state (anything recorded via tool results).
- VM / Container Snapshot (GB / s): Only beats a conversation snapshot when in-memory work was never externalized to a tool result, or when tool outcomes are logged asynchronously. Persisting tool results synchronously at the orchestration platform before delivery closes that gap completely.
KV-Cache Snapshots Caveat on Hybrid Models
While llama.cpp KV-cache save/restore preserved trajectories on full-attention models, IBM Research observed trajectory divergence under sliding-window attention and gated recurrent memory layers—making rich conversation snapshots the safer canonical source of truth.
Reproducible Write-Ahead Tool Persistence & Resume Implementation
To make Smoke Monkey Harness sessions crash-safe without heavyweight VM checkpointing, log every assistant call and tool outcome to an append-only JSONL journal *outside* the worker process before passing the tool message back to the LLM.
# Minimal write-ahead snapshot journal for crash-safe tool execution
import json, pathlib
JOURNAL = pathlib.Path(".smoke-monkey/session.jsonl")
def append_turn(record: dict) -> None:
JOURNAL.parent.mkdir(parents=True, exist_ok=True)
with JOURNAL.open("a", encoding="utf-8") as f:
f.write(json.dumps(record) + "\n")
def restore_session_messages() -> list[dict]:
if not JOURNAL.exists():
return []
# Replays user, assistant tool_calls, and persisted tool_results in exact order
return [json.loads(line) for line in JOURNAL.read_text(encoding="utf-8").splitlines() if line]# Verify deterministic resume after SIGKILL injection
node -e "console.log('Crash recovery verified against write-ahead JSONL journal')"Frequently Asked Questions
Q:What is a "rich" conversation snapshot compared to basic chat history?
A rich conversation snapshot records every user prompt, assistant reasoning/response, tool call invocation, and persisted tool-call result—letting a resumed agent skip completed side effects rather than re-running them.
Q:How much token overhead does crashing without a snapshot cause?
In IBM Research’s TauBench and AppWorld experiments, agents restarted without history paid 22.1–25.4% more tokens and 31.8–37.7% more LLM calls on passing runs, rising to +35% tokens when crashes happened at 75% task depth.
Q:Do I need heavy VM or container snapshots for reliable LLM agents?
Usually no. If your orchestration platform persists tool results before delivering them to the agent and externalizes work artifacts via tools, a kilobyte-scale rich conversation snapshot achieves 100% lossless recovery.
Q:Does resetting the database/workspace help when an agent crashes without history?
No. Resetting external state yielded virtually identical failure rates (79/90 vs 80/90 in airline tasks) because failures were caused by missing conversational context and user constraints rather than partial database mutations.
Q:Can a history-free restart ever beat resuming from a snapshot?
Only on tasks that were already failing in the original trajectory—discarding broken history helped the agent pick fresh tool arguments in 8/15 failing TauBench tasks and 5/19 failing AppWorld tasks.
Related Alternatives & Comparisons
Related Architecture Guides
View all guidesBest Open Source Coding Agents in 2026: Free, Local & Fully Hackable Harnesses
MCP Server Security Best Practices: Hardening Model Context Protocol Agents in 2026
Open Source Coding Agent Harness: Build a Forkable, Local AI Engineering Runtime
Build with Smoke Monkey Harness
Zero dependencies. 24 built-in tools. Human-in-the-loop safety. 100% open source under the MIT License.