AI NewsDev toolsAnnouncement

Vercel open-sourced durable-harness so a coding agent survives a crash mid-turn

Vercel released durable-harness, an open-source adapter that wraps Pi, Claude Code, Codex and OpenCode so a coding agent running in the cloud resumes from its own log after a function crash, a timeout or a dropped browser connection, without rerunning finished model calls.

AI News

Editorial3 min read

LinkedInX
Social card for the Vercel blog post announcing durable-harness

Image: Vercel

Why it mattersAn agent running in the cloud now keeps state in a durable log instead of in process memory, so a crashed turn resumes without re-paying for finished model calls or asking the user to restart from the beginning.

A coding agent that keeps a session in process memory loses the whole turn when the function dies, the connection drops, or a timeout fires. The agent has to be restarted and the finished model calls run again. Vercel released durable-harness, an open-source adapter that wraps four other coding-agent harnesses so the session lives in a log instead and a new function picks up where the old one stopped.

The library sits on Vercel's Workflow SDK. Vercel's own harnesses, fx and eve, were already durable, and this package extends the same machinery to any harness without changing the harness itself. The four harnesses Vercel names are Pi, Claude Code, Codex and OpenCode.

What the log records

Vercel's post describes the data model in one line. "Before a model call or tool call runs, it records an intent, and when the call finishes, it records the outcome." Each turn is also backstopped by a queue message, so a failing function hands the turn to a fresh function that reads the log and continues. The log tells a resumed function three things: what finished, what was running, and what never started.

Three rules follow from that split. Vercel says a completed model call is never run again, because the result is read from the log, so a crash does not get billed twice for the same tokens. An interrupted tool call marked replay: 'safe' runs again. Any other interrupted tool call is returned to the model as possibly having run, and the model decides whether to check. Harnesses that keep their own transcript, like Claude Code, Codex's rollout and OpenCode's event store, have every record mirrored into the log, so a new function or a new sandbox rebuilds the file from it.

Run on Vercel, self-hosted on Postgres, or on a local setup

The repository had 90 stars when it reached our candidate list. Vercel lists four options a user can pick between: run any of the four named harnesses durably on Vercel, self-host a harness with their own Postgres instance, make a local harness workflow durable, or build a new durable harness on the same interface. The runtime, called a World in the Workflow SDK, is a single TypeScript interface combining storage, a queue and a stream. Vercel says a task that only reads a database or calls a plain API can run in a function instead of a sandbox, which keeps secrets out of the sandbox the agent writes code in.

Two caveats Vercel states on the page. The documentation calls durable-harness and the Agent Harnesses section "beta", so the interface may still change. And the resume guarantee is for the session and the model and tool calls through the SDK: an unsafe side effect written by a tool call outside this contract is still the tool author's responsibility, which is why the replay: 'safe' flag has to be set by the person wiring the tool.

For a team moving a coding agent from a developer's laptop to a shared cloud, this changes what happens after a crash. The old plan was to restart the agent, re-explain the task and accept that the earlier model and tool calls were paid for twice. The log turns that into a resume: the new function reads what finished, replays only the steps that are safe to replay, and asks the model to pick up from the first unfinished step.

Source

Making every harness durable, Vercel, by Pranay Prakash and Eric Dodds.

Repository: vercel-labs/durable-harness on GitHub.

Documentation: Running Agent Harnesses Durably on Vercel.

SourceVercel

This item was written by an AI system from the linked source. Reveneau is responsible for what it publishes.

Share
LinkedInX
Start a project