Products & Tools

Vercel Open-Sources durable-harness for Crash-Proof Coding Agents

Vercel's open-source durable-harness logs every model and tool call so crashed agent turns resume without re-running or re-billing finished work. Adapters cover Pi, OpenCode, Claude Code and Codex.

Vercel Open-Sources durable-harness for Crash-Proof Coding Agents
Vercel Open-Sources durable-harness for Crash-Proof Coding AgentsWinston Chen / unsplash
By Elena Vasquez5 min read

Updated

Why it matters

  • Vercel released durable-harness, an Apache-2.0 npm package at version 0.0.x, with adapters for 5 harnesses: Pi, OpenCode, fx, Claude Code and Codex.
  • Finished model and tool calls are read back from a durable log and never re-run or billed twice.
  • Claude Code and Codex run only in a Vercel Sandbox, even self-hosted; Pi and OpenCode run in your own function.
  • Self-hosting requires 2 environment variables and a Postgres World (v5.0.4+, Node.js 22+).
  • No latency or throughput benchmarks are published; all recovery claims are self-reported by Vercel.

Vercel has released durable-harness, an open-source npm package that keeps coding agent sessions alive through crashes and timeouts. The package is at version 0.0.x, licensed Apache-2.0, and its adapters cover five harnesses: Pi, OpenCode, fx, Claude Code and Codex. It wraps those existing harnesses without changing them. For teams moving agents off laptops and into the cloud, that closes a real gap in how agent work survives infrastructure failures.

The stakes are straightforward. A dead function no longer means lost work. Each session lives in a durable log, and every model or tool call gets recorded before and after it runs. Vercel says finished calls are read back from the log, never re-run — and never billed twice.

What is durable-harness?

durable-harness is a set of adapters from Vercel that store a harness session in a Workflow SDK World. A World bundles storage, a queue and a stream behind one interface. The package uses the same machinery that powers Vercel's Workflow SDK.

The package arrives with clear limits. It's experimental, at a 0.0.x version. Claude Code and Codex run only inside a Vercel Sandbox, even for self-hosted deployments. And Vercel has published no latency or throughput benchmarks — all recovery claims are self-reported by the company.

Why do coding agents lose work in the cloud?

The problem starts with how these tools were built. Harnesses like Pi and Claude Code were designed as long-lived local processes. They keep the session in memory. Locally, the workspace and history sit on the same disk, so resuming takes one prompt.

The cloud breaks that assumption. According to the Vercel team, a VM with persistent storage does not track which calls completed. A failed turn or network error then means lost work.

How does durable-harness work?

The mechanics are a write-ahead log for agent turns. Before a model or tool call runs, durable-harness records an intent. When the call finishes, it records the outcome. Each turn is backed by a message on Vercel Queues. If the function dies, the queue hands the turn to a new function, which reads the log and continues.

After a crash, the log shows what finished, what was running and what never started:

  • Completed calls are read from the log, so finished model tokens are not billed again.
  • replay: 'safe' tools, such as lookups, can run again.
  • replay: 'never' tools, such as refunds, never run twice. The model is told the call may have happened, so it can check first before doing anything.

Harness session files are mirrored into the log as well. That covers Claude Code's transcript, Codex's rollout and OpenCode's event store. The model is also told when files are cleared between turns, and every harness waits for the log to record a 'never' call before it starts one.

Where do files and shell commands run?

Model-chosen commands never run on the function's own disk. The tools documentation lists three workspace options:

  • virtual() keeps files in the session log, with a bash-compatible shell and no network access. It holds about 500 files.
  • virtual({ durable: false }) keeps scratch files in memory and clears them every turn.
  • sandbox() gives each session its own Vercel Sandbox, with /workspace mounted on a Drive.

The virtual workspace suits short tasks and small projects. The sandbox option fits real projects and long-running work, with one Sandbox per session and a Drive that outlives every Sandbox.

Typed JSON documents, such as a to-do list, also live in the log. Each holds at most 64 KB.

Where can you run it?

The agent code stays the same across what Vercel calls Worlds:

  • Vercel: the Vercel World, with every session traced in Agent Runs. Resumed turns appear in the same trace.
  • Local: files on your machine, in .workflow-data by default, with no configuration.
  • Self-hosted: the Postgres World, version 5.0.4 or later, on Node.js 22+. Vercel's blog also lists MongoDB, Redis and Turso.

Two environment variables — WORKFLOW_TARGET_WORLD and WORKFLOW_POSTGRES_URL — move an agent to Postgres. Vercel cautions that the Postgres World is a reference implementation: no route auth, no encryption, not tuned for scale.

Which harnesses are supported?

Support varies, and the difference matters for anyone with an existing stack:

Harness Package Runs in Status
Pi durable-harness/pi-durable Your function + virtual workspace or Sandbox Supported
OpenCode durable-harness/opencode Your function + virtual workspace or Sandbox Supported
fx libfx Durable on its own Supported
Claude Code durable-harness/claude-code Vercel Sandbox only Experimental
Codex durable-harness/codex Vercel Sandbox only Experimental

Claude Code and Codex are single-user CLIs that keep state on disk, so each session gets its own Sandbox.

How does it compare?

durable-harness enters a market with established durable-execution players:

Feature durable-harness Temporal + OpenAI Agents SDK Inngest AgentKit Cloudflare Agents SDK
What it is Durability adapters for existing coding harnesses Durable execution wrapper for OpenAI Agents SDK TypeScript multi-agent framework Stateful agents on Durable Objects
Wraps Claude Code / Codex Yes, experimental, Sandbox-only Not disclosed Not disclosed Not disclosed
Durability backend Workflow SDK World (Vercel, local, Postgres) Temporal server or Temporal Cloud Inngest orchestration engine Durable Objects, Cloudflare Workflows
Language TypeScript Python TypeScript TypeScript
License Apache-2.0 MIT (server) Apache-2.0 MIT
Status 0.0.x, experimental GA since Mar 23, 2026 Not disclosed Not disclosed

The differentiator is scope. Temporal, Inngest and Cloudflare sell durable execution for agents you build yourself. durable-harness targets harnesses developers already use — including Anthropic's Claude Code and OpenAI's Codex — though those two remain experimental and Sandbox-bound.

What are the key takeaways?

  • durable-harness logs every model and tool call, then resumes crashed turns on a new function.
  • Finished calls are never repeated, so tokens are not billed twice.
  • Pi and OpenCode run in your function; Claude Code and Codex need a Vercel Sandbox.
  • Self-hosting works with two environment variables and a Postgres World.
  • It is 0.0.x and experimental, with no published benchmarks.

The code is on GitHub under vercel-labs, alongside Vercel's documentation and the announcement post, "Making Every Harness Durable." With the API still at 0.0.x and recovery claims unbenchmarked, teams adopting it now are effectively piloting Vercel's durability layer before it stabilizes — and betting that crash-tolerant agent sessions become table stakes as coding agents move fully into the cloud.

Original: github.com

Share this article:

More from Elena Vasquez

Elena Vasquez

Show full bio

Market editor covering technology and product news in artificial intelligence and machine learning at AI In Context.

307 articles

Related articles

  1. OpenAI's GPT-5.1-Codex-Max runs coding tasks for 24 hours straight
  2. Restate raises $20M Series A to challenge Temporal in agent infrastructure
  3. OpenAI's DevDay 2026: Codex Gets Cloud Environments and Security Scans
  4. OpenAI unveils GPT-5-Codex, a coding-tuned variant of GPT-5
  5. OpenAI ships a model-native harness and native sandboxes for its Agents SDK

« Previous articleNext article »