Vercel's durable-harness Enables Automatic Crash Recovery for AI Agents

Vercel open-sources durable-harness, an adapter that adds durable execution to coding agents like Claude Code and Codex by logging every model and tool call to a persistent log, enabling automatic recovery after crashes with configurable replay strategies for safe and unsafe tools, flexible deployment from local files to Postgres, and multiple filesystem modes for different workloads.

AI Engineering
AI Engineering
AI Engineering
Vercel's durable-harness Enables Automatic Crash Recovery for AI Agents

Introduction

Vercel has released durable-harness, an open-source project that aims to eliminate the scenario where an AI coding agent loses all progress when the host machine crashes or loses power. The project adapts Vercel's internal durable-execution infrastructure — originally built for the eve agent and the Workflow SDK — so that existing coding-agent runtimes (called "harnesses") can persist every step to a durable log and resume seamlessly after a failure.

Supported Harnesses

Directly compatible: Pi, fx, eve — these are designed for embedding and work out of the box.

Require an extra sandbox: Claude Code, Codex, OpenCode — because they were not built for embedding, they need an additional sandbox layer to participate in the durable log.

Core Architecture: Sessions as Workflow Runs

Each agent session becomes a single Workflow SDK run. Every model invocation and every tool call is recorded in two phases:

Intent — the planned action is written to the log.

Outcome — the result (or error) is appended to the same log entry.

All entries go into one durable log. If the running function dies, a queue hands the turn to a fresh function instance, which reads the log and continues from the last completed step. Because completed call results are fetched directly from the log, the same model call is never paid for twice.

Tool Replay Strategies

The replay policy for tool calls is a critical design point:

Safe tools (e.g., reading files, checking status) are automatically re-executed after a crash.

Never tools (e.g., issuing refunds, sending notifications) are never run a second time. The model is simply informed that "this call may have already happened."

This distinction prevents duplicate side-effects while allowing idempotent operations to retry transparently.

Deployment Flexibility

The persistence backend is configurable via two environment variables:

Local development: default file-based storage.

Vercel-hosted: uses Vercel's managed infrastructure.

Self-hosted: point to a Postgres database.

Switching between these targets requires no code changes — only the environment variables — so the entire agent can move from Vercel's cloud to a private Postgres instance while keeping the same durable log semantics.

Filesystem Modes

Three filesystem abstractions are provided to match different workload needs: virtual() — files are stored inside the durable log; suitable for short-lived tasks. virtual({durable:false}) — in-memory temporary files that are discarded at the end of each turn. sandbox() — provisions an independent Vercel Sandbox with /workspace backed by Vercel Drive; intended for real-world projects that need a persistent, isolated workspace.

Documents: Structured Agent Memory

Beyond chat history, durable-harness introduces Documents — typed JSON structures (to-do lists, plans, etc.) that are stored alongside the log and shared with the application. This expands the agent's "memory" to include workspace files and task-tracking artifacts, not just conversation context.

Open Source & Community Feedback

The project is built on the Workflow SDK 's World interface and is available on GitHub: https://github.com/vercel-labs/durable-harness.

A community member noted that recoverable harnesses have existed before, but durable-harness distinguishes itself by making the entire compute layer ephemeral — all state lives in the log — enabling true cross-machine recovery.
Architecture diagram showing durable-harness log flow
Architecture diagram showing durable-harness log flow
Tool replay strategy illustration
Tool replay strategy illustration
Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

AI agentsVercelcrash recoverydurable executiondurable-harnesspersistent loggingtool replayWorkflow SDK
AI Engineering
Written by

AI Engineering

Focused on cutting‑edge product and technology information and practical experience sharing in the AI field (large models, MLOps/LLMOps, AI application development, AI infrastructure).

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.