---
type: "Blog Post"
title: "The Harness Is Becoming the Runtime"
description: "A builder's read on durable execution moving into the agent harness: wrap your agent in Temporal versus owning a durable harness, what LangGraph's checkpointer actually guarantees, Pi Durable's replay policy, and how to choose."
resource: "https://og.rsts.dev/blog/the-harness-is-the-runtime/"
status: "stable"
generated:
  by: "human:orestes-garcia"
  at: "2026-10-16"
verified:
  - by: "human:orestes-garcia"
    at: "2026-10-16"
sources:
  - id: "canonical"
    resource: "https://og.rsts.dev/blog/the-harness-is-the-runtime/"
    title: "The Harness Is Becoming the Runtime"
    author: "human:orestes-garcia"
    last_modified: "2026-10-16"
x-ogrsts-published: "2026-10-16"
x-ogrsts-read-time: "9 min read"
---

A long-running agent dies at the wrong moment. Not an exception you wrapped in a try/catch. The laptop sleeps, a deploy rolls the process, the container gets recycled, and the thing that was six hours into a job comes back knowing nothing.

The tool call that was halfway out the door either never fired or fired twice. The agent cannot tell you which. Whatever it reasoned its way to is gone, and you are paying tokens to watch it rediscover it.

For a demo you restart. For anything a business leans on, that is the whole problem, and the fix the whole industry reached for this year was not a smarter model. It was durability, and it is moving inside the harness.

## Durability moved into the agent loop

Durable execution is old: record each step's result in a log so a crashed process replays and skips finished work. It ran in the back office for years. In 2026 it walked into the agent loop, because an agent loop is the exact shape of problem it was built for. Restate put it cleanly last June: [agents behave a lot like distributed systems](https://restate.dev/blog/durable-ai-loops-fault-tolerance-across-frameworks-and-without-handcuffs), where "every tool call is a remote hop, every user interaction is a pause, every retry risks doing the same work twice."

Then everyone shipped: [AWS Lambda durable functions](https://aws.amazon.com/about-aws/whats-new/2025/12/lambda-durable-multi-step-applications-ai-workflows/) (suspend up to a year, no compute billed while waiting), Anthropic's [Managed Agents](https://www.anthropic.com/engineering/managed-agents) (a durable session log a crashed harness reloads), Cloudflare [Project Think](https://blog.cloudflare.com/project-think/) (durable "fibers" in SQLite), and [Temporal raising at a $12.55 billion valuation](https://thenextweb.com/news/temporal-550m-series-e-12-55bn-valuation-lightspeed). The question for a builder is not whether durability matters. It is where you put it.

## Two ways to make an agent survive a crash

**Wrap the agent.** Keep your agent framework, bolt a durable engine underneath, and let the engine journal every model and tool call as a replayable step. This is Temporal plus the [OpenAI Agents SDK](https://temporal.io/blog/announcing-openai-agents-sdk-integration), DBOS, Restate, Lambda. Each tool call becomes an activity in a workflow whose history replays on crash:

```python
# wrap: each tool call is a journaled activity; completed ones are not re-run
@activity.defn
async def call_tool(name: str, args: dict) -> dict:
    return await TOOLS[name](args)

@workflow.defn
class AgentWorkflow:
    @workflow.run
    async def run(self, task: str) -> str:
        history = []
        while not self.done(history):
            step = await workflow.execute_activity(
                call_model, history, start_to_close_timeout=timedelta(minutes=2))
            out = await workflow.execute_activity(
                call_tool, step.tool, step.args,
                start_to_close_timeout=timedelta(minutes=5))
            history += [step, out]
        return self.final(history)
```

You inherit a decade of hardened infrastructure. You also inherit determinism rules and a workflow engine whose mental model never quite fits an open-ended loop.

**Make the harness itself durable.** Instead of a general engine wrapping an agent-shaped hole, the durability primitives are agent-native: conversations, checkpointed steps, per-tool replay policy, an ownership tree for subagents, compaction as a background task. This is Anthropic's session log, Cloudflare's fibers, and a new open-source project, Pi Durable.

*(Figure: Two-panel architecture diagram. The left panel, labeled Wrap the Agent, shows an Agent SDK such as LangGraph sitting inside an external workflow engine such as Temporal, with each LLM call and tool call drawn as a step journaled to an event history outside the agent. The right panel, labeled Durable Harness, shows the durability primitives living inside the harness itself: tasks and checkpoints, replay policy, an ownership tree, and multiplayer views, all sitting on pluggable storage drawn as SQLite, JSONL, and a Cloudflare Durable Object.. See the original post for the image.)*

I have argued that [the harness is the layer worth owning](../posts/own-the-harness.md), because it is the part the model vendor does not control. Durability is where that stops being philosophy and starts being an on-call rotation.

## What LangGraph's durability actually is

Most teams reach for LangChain and [LangGraph](https://docs.langchain.com/oss/javascript/langgraph/persistence) first. Know what its durability is before you lean on it. LangGraph persists graph state as checkpoints and resumes a thread from the last one:

```python
from langgraph.checkpoint.postgres import PostgresSaver

graph = builder.compile(checkpointer=PostgresSaver.from_conn_string(DB_URL))
# state is snapshotted at each super-step, keyed by thread_id
graph.invoke(state, config={"configurable": {"thread_id": "run-123"}})
# interrupt() pauses for human input; resume by invoking again on the same thread_id
```

That is a snapshot of state at super-step boundaries, not a journal of every individual model and tool call. For conversation continuity, human-in-the-loop, and recovery between nodes, it is enough. For a six-hour agent with external side effects, a crash mid-step is exactly the gap, which is why teams pair LangGraph with a workflow engine and end up running two mental models.

## What a durable harness does differently

Pi started minimal: Armin Ronacher (Flask) [called it](https://lucumr.pocoo.org/2026/1/31/pi/) the coding agent he uses almost exclusively, "the shortest system prompt of any agent that I'm aware of" and "only four tools: Read, Write, Edit, Bash." So a durability layer from the same shop (Earendil) was a surprise; they kept it in a separate [experimental package](https://earendil.com/posts/pi-durable/), about fifteen thousand lines, small enough for an agent to read its own runtime. What it gives a builder:

- **Every step is a task that checkpoints before it moves on** (model request, tool call, compaction). After a crash a new process finds unfinished tasks and resumes each from its last checkpoint.
- **Recovery is a policy, not a blind replay.** The interesting primitive. A tool declares whether it is safe to rerun; everything else is reported to the model as interrupted, so it decides. That handles LLM nondeterminism that classic deterministic replay chokes on:

```ts
// Pi Durable, experimental API (illustrative shape)
harness.tool("getStatus", {
  replay: "safe",                              // idempotent: rerun verbatim on recovery
  run: async (a) => orders.status(a.id),
})
harness.tool("refund", {
  // no replay policy: on recovery the model is told this call was interrupted,
  // and chooses whether to retry, so you never silently double-refund
  run: async (a) => payments.refund(a.id),
})
```

- **Subagents are just conversations with an owner**, so they survive crashes like any conversation and aborting a parent cleans up its children.
- **Storage is pluggable** (memory, SQLite, JSONL), and the SQLite/JSONL code avoids Node APIs so it runs on Bun or inside a Cloudflare Durable Object.
- **Multiplayer:** clients get a view plus incremental updates, and any client can steer a running conversation.

Cloudflare shipped a hosted `PiHarness` in its Agents SDK the next day, running inside a Durable Object. A platform building hosting for an experimental framework in twenty-four hours is a bet on direction.

## The decision

- **Wrap LangGraph in a durable engine (Temporal/DBOS)** when you already run one, you have the ops muscle, and you want proven versioning, scale, and observability more than conceptual fit. Safe enterprise default.
- **Own a durable harness** when the agent is the product, you want a control plane you can read in an afternoon, and you need to embed it somewhere specific (a Durable Object, your own VPC). You trade maturity for fit.
- **Stay on plain LangGraph checkpoints** when runs are short, tools are idempotent, and a crash is a cheap restart. The best counterpoint of the year is literally titled ["You Don't Need Temporal Yet."](https://hackernoon.com/you-dont-need-temporal-yet-durable-execution-for-ai-agents-in-150-lines)

The thing worth stealing from Pi Durable is not the package, it is the contract: a durable harness exposes tasks, replay policies, and an ownership tree as named, inspectable things. Hold that contract whether you build on Pi, extend LangGraph, or write your own. Same instinct as [stealing the contract, not the catalog](../posts/steal-the-contract-not-the-catalog.md).

## The part I won't pretend away

- **Owning the harness is homework.** Wrap in Temporal or Lambda and you inherit versioning, scale, observability, and an ops team. Own it and that is all yours. Pi Durable is explicit: experimental, TypeScript-only, Node-only runtime, single-owner storage.
- **Replay safety is on you.** A careless `replay: "safe"` on something that charges a card is a foot-gun you built.
- **Durability is not exactly-once.** External side effects still need idempotency keys or receipts; no framework changes that.
- **Durability is not memory.** A durable log is not unlimited context; compaction strategy still matters. As [stacktoheap](https://stacktoheap.com/blog/2026/10/05/pi-durable/) put it, "visible state is committed state."
- **Do you even need a never-ending agent?** Good uses exist: background coding jobs, multi-hour investigations, on-call agents, an assistant per customer. If you cannot name yours, you have a demo, and a demo can restart.

## Where this leaves you

The harness is absorbing what the workflow engine used to do. The model is a rental you do not control. The harness is the part you keep, and this year it grew a spine: durability is becoming a property of the runtime your agent lives in, not a service you call. The question is not whether your agents will be durable. It is whose durability you are standing on when one wakes up at hour seven and has to figure out what it already did. Pick that while it is a design decision and not an incident.

---

*The companion read is [You're Renting the Model. Own the Harness.](../posts/own-the-harness.md), the same argument a year earlier, before the harness learned to survive a crash.*

*I write about AI-assisted development, enterprise architecture, and building in regulated environments. If you are deciding where to put durability in your agent stack, find me on [X @orestesgarcia](https://x.com/orestesgarcia) or [LinkedIn /in/setsero](https://www.linkedin.com/in/setsero).*
