Notes
Oct 29, 2026 · Bradley Leatherwood

Notes
Oct 29, 2026 · Bradley Leatherwood


Most bot harnesses are built around one conversation: one person, one thread, one turn at a time. The agent's state belongs to that thread, so nothing else can change it while the agent works.
The agents we build for Zerbly work differently. One agent talks to many people at once, and its turns run concurrently, each in its own thread. Those threads share one state: the agent's permissioned memory, its notes and the calendar it manages. That calls for a different kind of harness: one with multi-threading built in.
Imagine one of these agents scheduling a meeting with twenty people. Each person talks to it in their own conversation. The agent keeps its working notes in a file: who's free, which slots are held, and who has confirmed.
Now Ana and Ben both message it at the same moment. Each conversation reads the notes, and both see that Thursday at 2pm is open. If both turns go ahead, Ana and Ben are each offered Thursday at 2pm. Same slot, offered twice, and one of them is about to be disappointed.
This isn't a model problem. A perfect model makes the same mistake, because each turn read the same notes and neither could see the other. It's a concurrency problem, and harnesses built for one thread don't handle it. In a multi-threaded agent it's the normal case. Our harness handles it with one rule: commit before you show. Nothing an agent says to a person, and nothing it does in the outside world, leaves the system until the work behind it is committed.
Here's how that works in the AI constructs that run Zerbly's bots.
A construct serves many people across many lanes: direct messages, group threads, channels and calls. In our hosted configuration, one construct runs up to 25 conversation turns at the same time and queues any beyond that. Those lanes share state. Person facts such as a name, timezone or quiet hours are visible in every lane that can see that person, and the construct keeps its own files, like that scheduling note.
In our hosted deployment, each construct is a Cloudflare Durable Object with its own SQLite database, and its files live in that database. Between messages nothing runs. Cloudflare evicts an idle object, and an alarm wakes it when a wait or a reminder comes due.
When the agent works, the model writes small TypeScript cells and runs them. Each cell runs as a preview on a copy-on-write (CoW) branch of the construct's database. The branch is pinned to the latest committed revision, and the preview's writes are stored as private row versions.
So Ana's turn can read the notes, mark Thursday 2pm "held for Ana" and draft a reply that offers it. Ben's turn can do exactly the same on its own CoW branch. The model sees those results. Nobody else does: no reply has been sent, and the notes on main haven't changed.
A cell that fails contributes nothing, and the next cell starts from the last one that succeeded. Model calls hold no database transaction while they wait.
When the agent wants its work to count, it commits. The construct's scheduler collects the previews that are ready, orders them by causal prerequisites, and replays them once against the current state, inside one transaction.
Replay doesn't trust the preview. It runs the reads again and compares what they return with what the preview saw. Reading a file is one of those checked observations: the file's contents are part of the comparison.
Ben never sees the 2pm offer, because it never existed outside a branch. The closest analogy is a merge queue: a pull request that passed CI against an old main is rebuilt against the current main before it lands. Here the change is to the agent's notes instead of to code.
The notes are the agent's working memory, not the calendar. Writing the meeting into the actual scheduling tool is an external effect, and you can't roll an external effect back. So it doesn't run inside the script.
A tool call that changes something outside the construct becomes a workflow start. (An MCP tool runs directly only if its server is trusted as read-only and the tool is marked read-only and non-destructive.) During preview, the start is only an intent row on the branch, so Ben's discarded preview takes its calendar write with it. If a later cell in the same operation starts the same request again, it gets the original workflow back instead of a second one. At commit, the workflow instance is created inside the commit transaction. It runs only after that transaction is durable, and that's when the calendar is actually written.
One person, one thread, one turn at a time was a fine place to start. Bots that serve a team, a front desk or a community don't work that way. They hold many conversations at once over shared memory, and every message they send has to be true when it's sent. That's what we're building: multi-threading for bot harnesses, with commit before you show as the rule underneath.
Other teams are reaching related ideas from different directions: