AI News Feed
Market watch
Products & Applications

Vercel Open-Sources durable-harness to Keep Coding Agent Sessions Alive Through Crashes

Vercel has released durable-harness, an Apache-2.0 npm package that logs each step of a coding agent turn so a crashed or timed-out cloud function can resume instead of losing work. It wraps Pi, OpenCode, fx, Claude Code and Codex.

The package is published as version 0.0.x under the Apache-2.0 license and wraps five existing harnesses — Pi, OpenCode, fx, Claude Code and Codex — without modifying them. Its adapters store a harness session in a Workflow SDK World, an interface that bundles storage, a queue and a stream behind a single API; Vercel says the package uses the same machinery that powers its Workflow SDK. It can run on Vercel Functions with Vercel Queues, on Node.js 22 or later with Postgres, or on files on a laptop.

The gap it targets is specific to the cloud. Harnesses such as Pi and Claude Code were designed as long-lived local processes that hold session state in memory. On a laptop the workspace and history sit on the same disk, so resuming takes one prompt. On a cloud VM with persistent storage, nothing tracks which calls completed, and a failed turn or a network error means lost work.

To close that gap, durable-harness records an intent before a model or tool call runs and records the outcome when the call finishes. 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. The log shows which calls finished, which were running and which never started. Completed calls are read back from the log rather than re-executed, so finished model tokens are not billed a second time.

Tool calls carry a replay policy. Tools marked "safe", such as lookups, may run again after a crash; tools marked "never", such as refunds, do not run twice, and the model is told the call may already have happened. Harness session files are mirrored into the log as well, covering Claude Code's transcript, Codex's rollout and OpenCode's event store.

Model-chosen commands never run on the function's own disk. The tools documentation lists three workspace options: virtual(), which keeps files in the session log with a bash-compatible shell and no network and holds about 500 files; virtual({ durable: false }), which keeps scratch files in memory and clears them every turn; and sandbox(), which gives each session a Vercel Sandbox with /workspace on a Drive. Typed JSON documents such as a to-do list also live in the log, capped at 64 KB each.

Vercel has not published latency or throughput benchmarks, and the recovery claims are self-reported by the company. The 0.0.x API is experimental. Claude Code and Codex run only inside a Vercel Sandbox, including when the package is self-hosted.

Editor's Summary

Vercel has open-sourced durable-harness, an Apache-2.0 package that logs each step of a coding agent turn so cloud functions can resume after crashes without re-running completed model calls. It wraps five existing harnesses unchanged and runs on Vercel Queues, Postgres or local files. The release is experimental at version 0.0.x, ships without latency or throughput benchmarks, and confines Claude Code and Codex to a Vercel Sandbox.