thepragmaticquant.com

Explainers · Agent-systems reliability

How do I get AI coding agents from different vendors to coordinate on one machine without polling?

Give them a shared local event bus and have each agent block on a subscription instead of re-reading a file. The coordination primitive has to live outside every vendor's runtime, because no vendor's runtime can see another's.

August 10, 2026 · evidenced by waitbus

Why the file-and-poll pattern is the default, and what it costs

Two coding agents on one workstation have no channel between them. The workaround everybody reaches for is a shared file: one agent writes a status line, the other re-reads it on a loop. It works, in the sense that the information eventually arrives.

The costs are three, and they compound.

Every poll is a full turn — a prompt, a read, a model response, tokens billed, for the overwhelmingly common case where nothing changed. Latency is bounded below by the poll interval, so a shortened interval buys responsiveness by buying more of the first cost. And a poll only ever observes state, so an agent that crashed and one that has not started yet look the same, and a failure that happens between two polls is a failure nobody hears about.

That third cost is the one that actually breaks fleets. A supervisor waiting on four agents will wait the full timeout for the one that died, because nothing told it otherwise.

What to build instead

A local event bus, running as its own process, that agents publish to and subscribe on. Subscription is a blocking wait: the agent asks for the next event matching a filter and the call does not return until one arrives. Zero turns consumed while waiting, and wake-up latency is the delivery time rather than the poll interval.

Three design points matter more than the transport choice.

It must be outside every vendor’s runtime. Claude Code, Cursor, Codex and the rest each have their own sub-agent and task machinery, and each of those is blind to the others by construction. A coordination primitive implemented inside one of them coordinates that one. The bus has to be a separate process every runtime can reach — which in practice today means MCP, since that is the one interface all of them speak.

Failure has to be a first-class event. The reason to leave polling is not efficiency, it is that a failure needs to be announced. If an agent’s crash does not publish anything, you have built a faster poll rather than a different architecture. Publishing on abnormal exit is the part that repays the effort.

Waiting must be cancellable and bounded. A blocking wait with no deadline and no cancel path is a deadlock waiting for a reason. Every subscription needs a timeout the caller chose and a way to be woken early.

What this does not solve

It is a coordination channel, not a scheduler and not a merge strategy. Two agents editing the same file still conflict; the bus lets them find out immediately instead of at merge time, which is a real improvement and not the same as a fix. Nor does it decide who does what — a bus carries messages, and the division of work is still yours to design.

It is also worth saying that the honest alternative for two agents and a simple handoff is a file and a poll, and that is fine. This becomes worth building at the point where you have several agents, care about failure latency, or are running vendors that cannot see each other.

What is already built

waitbus is a workstation-local event bus with exactly this shape: agents wait on events rather than polling, and they hear each other fail. It ships on PyPI with SLSA build provenance — a sigstore-signed in-toto attestation, generated by slsa-github-generator, whose sha256 digests match the wheel and the sdist PyPI actually serves. That last clause is the part worth checking rather than believing, and the release page above is where to check it.

Check this yourself

waitbus 0.2.0 ships on PyPI with SLSA build provenance: a sigstore-signed in-toto attestation, generated by slsa-github-generator, whose sha256 digests match the wheel and the sdist PyPI actually serves.

If this is your problem

I consult on multi-agent systems that poll, hang, or report finished while work is still in flight. The entry point is a agent-fleet reliability audit: a written teardown of every place your fleet infers completion from a timeout, a poll, or a stream close — each one carried by the trace that reproduces it, with a ranked fix list you keep.

Email me about an engagement What to put in it →

Tell me which of the above you have already tried, and what it did instead. sankalp.gilda@gmail.com