All posts
Technical
  • #agents
  • #state
  • #durable-execution

Agent state and durable execution

04.05.2026·14 min

Agent state and durable execution

Agent Systems · 21-c03

26 June 2026 · State and durability

A production agent's reliability often depends on state design before model quality. If the system cannot tell where it stopped, which tool result it trusted, and which side effect already happened, intelligence becomes luck.

Core split
state != durability
Key term
checkpoint
Operation
replay + redrive
Risk
repeated side effects

Key terms in this post

  • conversation state
  • task state
  • tool state
  • checkpoint
  • durable execution
  • rollback
  • idempotency
  • compensation

The previous posts covered agents through goals, tools, loops, and architecture. This one moves into the less glamorous layer: agent state.

Saving chat history is not durable execution. Conversation state helps the model continue; durable execution defines how a multi-step job survives crashes and resumes without repeating unsafe side effects.

01/08

State layers

State is the meaningful information a system carries into the next decision. In agents, it is not one box: conversation state, task state, tool-result state, and side-effect state have different durability needs.

This distinction matters because not all state can be rolled back in the same way. A summary can be corrected; a double charge is a different problem.

Four state layers

conversation state

User intent, message history, summary, and active context.

task state

Plan, node, step, dependency, and intermediate output.

tool-result state

Tool input, output, error, retry count, and evidence.

side-effect state

Writes that have happened in the external world.

context -> progress -> evidence -> external truth
02/08

Conversation state

Conversation state keeps the model inside the same conversation. Message history, summaries, system instructions, response IDs, and sessions belong here.

It does not by itself prove which tool calls ran, which files changed, or which step can be safely retried.

Conversation memory is necessary for UX, but it is only one input to durable execution.

What conversation state carries
context

The user's intent and previous answers remain available.

cost

Long history increases token and context pressure.

boundary

Tool side effects and progress need separate records.

03/08

Task state

Task state describes where the agent is in the work: plan item, node, dependency, interrupt, or terminal state.

Graph systems separate checkpointers for thread-scoped state from stores for durable cross-thread information.

Task state flow
01

request

The request becomes a task spec.

02

plan

Steps and dependencies are produced.

03

step

The active node and output update.

04

interrupt

Failure, approval, or wait state is recorded.

05

resume

The same thread continues from a safe point.

04/08

Tool state

Tool state is the evidence ledger for external contact: inputs, outputs, errors, latency, retries, and operation IDs.

Idempotency means the same operation key does not create the same external effect twice.

Retries are useful, but without recorded tool state they can amplify side effects.

Tool state record

operation id

Stable key for the same work.

input hash

Comparable representation of the tool request.

result payload

Saved observation for later reasoning.

side effect marker

Whether a write happened outside the agent.

retry policy

Which errors may be retried and how often.

05/08

Checkpoint

Checkpoint is not a raw memory dump; it is a logical snapshot of the workflow's state.

Its value is that it can be inspected, resumed, forked, or migrated.

Thread IDs, checkpoint IDs, parent IDs, schema versions, and tool evidence become the debugging spine.

Checkpoint anatomy

thread_id

Conversation or job line.

checkpoint_id

Unique snapshot identifier.

parent_id

Previous point for fork and audit.

state_snapshot

Serializable task state.

tool_evidence

Trusted tool results so far.

schema_version

How old state should be read.

06/08

Durable execution

Durable execution lets a long-running job live beyond a single process.

Event sourcing records the events that created state rather than only the current state.

LLM calls, HTTP requests, time, randomness, shell commands, and browser clicks should sit behind recorded tool/activity boundaries.

Record / replay line
1

command

The orchestrator requests work.

2

event

The runtime persists the outcome.

3

replay

Code rebuilds state from history.

4

resume

New decisions start from the safe point.

replay deterministik kalır; nondeterministic işler tool/activity sınırında kaydedilmiş sonuç olarak okunur.
07/08

Rollback and redrive

Rollback is not always a database-style undo. External side effects often need compensation.

Redrive means continuing from a failed or safe step rather than rerunning everything.

The system must know what is preserved, what is rerun, and what must never be repeated.

After-failure decision tree

read failure

retry

Repeat a bounded read.

wrong state

fork

Open a new branch from a checkpoint.

write happened

compensation

Record a corrective external action.

schema changed

migration

Move old checkpoints into the new schema.

08/08

Production notes

Good state design makes an agent more accountable. You debug through checkpoints, event history, tool evidence, and side-effect records.

Conversation state gives UX continuity; task state manages work; tool state preserves evidence; durable execution lets the whole system outlive a process.

Agent state checklist
1

Conversation

How is history summarized and trimmed?

2

Task

Are active steps and terminal states structured?

3

Tool

Are inputs, outputs, and errors recorded?

4

Idempotency

Do write tools accept stable operation IDs?

5

Checkpoint

Can state be inspected, resumed, forked, and migrated?

6

Replay

Are nondeterministic actions behind tool/activity boundaries?

7

Compensation

Do irreversible effects have corrective flows?