Agent Host Protocol

2 min read Original article ↗

Agent Host ProtocolSynchronized multi-client state for AI agent sessions

A portable, standalone server protocol that gives multiple clients a synchronized view of AI agent sessions through immutable state, pure reducers, and write-ahead reconciliation.

U

The autoplay demo will send a message...

A

Actions and reducer output will appear here.

How it works

One agent session. Any client.

AHP turns an agent session into a shared, synchronized resource that any number of clients can attach to at once. Here's the journey, from the problem to the wire.

01 The problem

An agent session is stuck wherever it started.

The conversation, the turns, the pending tool approvals — they're tied to a single app or harness. Switch to another client, device, or automation and you can't pick up the same live session. AHP makes a session a shared resource, so it can live once and be driven from anywhere.

02 The shape

One host sits between many clients and many agents.

In the lineage of LSP and DAP, the host owns the authoritative session state. Clients speak AHP; agent backends integrate directly. Any client can drive any agent — and every client stays in sync.

03 On the wire

Every change is one envelope, totally ordered.

The host stamps each mutation with a monotonic sequence and broadcasts it to every subscribed client. That single ordered stream is what keeps every window in sync.

Host broadcast to every client

41chat/turnStarted"Add retry logic to the API client"

42chat/delta"Sure — I'll wrap the fetch call…"

43chat/toolCallStartEdit file · src/api.ts

46chat/toolCallCompleteok · 1 file changed

47chat/turnCompleteturn t_8c1 done

04 Reconciliation

Apply optimistically. Reconcile when the echo returns.

A client applies its own action locally right away, then matches the server's echo — stamped with origin — back to its optimistic copy. Concurrent edits from other clients fold into the same ordered stream.

Client

optimisticdispatch(turnStarted)clientSeq 7 · applied locally

Host

confirmedserverSeq 41origin { ide, 7 } · reconciled