Repository navigation
v0.2.0 — wake delivery works, and is proven
v0.1.0 shipped the bus. It turned out the wake did not work on any harness — and the reason it looked like it worked is the interesting part.
The bug under the bugs
A seat is <tool>/<worktree>.<inst>. Hooks and the agent's own shell were resolving to different seats for the same session: hooks registered as the bare scope, the shell as the instance. The read cursor, watch flag, and PM role then lived in different files. A digest re-showed the same packets until MAX_SHOWS and went quiet, directly addressed mail never arrived, and watch on armed a flag the Stop hook never read.
Nothing errored. agent-bus read honestly reported "nothing unread," which is indistinguishable from a quiet repo. Observed on Codex with both seats live at once for one session, and on Cursor.
Hook entry points now read the host's JSON payload on stdin and take its session_id when the environment carries none. That single change is what makes Codex and Cursor land on one seat.
Wake goes to the owner, not the room
A supervisory packet sent to a broadcast scope reached every seat in scope as actionable work: four agents in a worktree all woke on one peer's needs-review and all four grabbed it. A packet now has exactly one owner — the direct, scope, or named addressee, an @pm target, or a PM auto-CC supervisor. Broadcast copies still appear in the digest, labeled as context, and never wake.
OpenCode 2
The plugin refused to load on 2.0.8, so every delivery path for that host was dead while the seat still looked alive. One file now serves both majors: v2 reads the default export's id and setup(), v1 calls server(), and both drive the same bus logic.
Three things only the running host revealed: imports must be type-only, because the installed plugin has no node_modules; the config entry must be a directory, not a bare .ts; and ctx.event.subscribe is the server's stream, so four open projects meant four plugin instances each claiming every session until ownership was resolved per session.
Then the wake still did not fire. Idleness was read only from session.idle, which is in the v2 schema but never fires on this host, and the poll loop meant to catch mail arriving mid-idle was gated on that same flag. Idleness now derives from the execution lifecycle.
Cursor
User-level hooks run from ~/.cursor, not the workspace, so identity resolved to a seat with no watch flag and every wake silently no-opped. The adapter re-anchors on CURSOR_PROJECT_DIR or the payload's workspace_roots, follows up only on a completed turn so an aborted one is never auto-continued, and always emits JSON. Cursor also runs the Claude-format hooks in ~/.claude/settings.json with its own payload shape; the CLI recognizes that and stands down.
agent-bus selftest
Every test before this ran the CLI directly with a pinned identity, so nothing verified that hooks fire or that their output reaches a model. That is exactly the layer both identity splits lived in, and for a GUI-driven agent no headless runner can reach it.
agent-bus selftest # arms a probe addressed to your own seat
agent-bus selftest check <nonce> # next turn: verifies the whole pathIt confirms from bus state that a hook touched this seat after arming, that the digest surfaced the probe, that the Stop hook continued the seat, and — only if you supply the nonce, which you could only have learned from the injected digest — that hook output actually reached the model.
Also
agent-bus cost reports what the bus has injected per seat, reconstructed from the ledger. That measurement showed repeat surfacings were 51% of every byte ever injected, mostly packets re-shown because the ack landed on a split seat; bodies now render once per seat.
PM packets are marked as delegated scope. A PM is a seat you put in charge, so what it assigns is your intent relayed, not a peer suggestion. What no packet can do — PM included — is grant a permission the reader's harness denies, and that is what the banner now says.
doctor flags stale hook installs, naming which guarantee is missing. It caught a Codex Stop hook still running heartbeat instead of stop-hook, so no Codex session could ever have been woken.
Security: hook capture wrote host env to disk by prefix sweep, which persisted CLAUDE_CODE_MESSAGING_TOKEN in the clear at mode 0644 and would have caught any future *_TOKEN or *_KEY. It now records an allowlist of identity markers under umask 077 and chmod 600. If you ran a build between 0f91e2a and 1051198, clear ~/.agents/bus/state/capture/.
release --force breaks a dead seat's live claim, announced and recorded in the ledger — the protocol's "post a question" assumed the holder was alive to answer. Flag-shaped arguments are no longer stored as paths.
Installers write through symlinks instead of replacing them, so a dotfiles-managed host config survives.
Verified
| Harness | Status |
|---|---|
| Cursor | live: hooks, digest, nonce injection, Stop-hook wake |
| Claude Code | live: identity, hooks, digest, nonce injection |
| OpenCode 2.0.8 | live: load, seat scoping, unprompted idle wake |
| Codex | covered by tests; selftest inside Codex Desktop still pending |
The OpenCode wake was confirmed from outside the host: a packet posted to an idle watch-enabled chat produced a reply carrying the posted nonce four seconds later, with the seat's wake counter incrementing in the same second and no human input. A model cannot tell a successful resume from a normal turn by introspection, which is why the nonce was necessary.
291 tests, up from 128, green both in a clean environment and with hostile AGENT_BUS_* knobs set: ./test/agent-bus.test.sh
Upgrade
git pull && ./install-hooks.sh # Claude Code, Codex, Cursor + OpenCode plugin
agent-bus doctor # confirms hooks fire and flags stale installsRe-running the installer is required: this release changes the hook lines and the OpenCode plugin layout. Restart OpenCode and Cursor afterwards; both read config at launch.
Trust model
Unchanged, and worth restating. Seat identity is self-asserted by design — this is a cooperative coordination layer for agents already running as your user, not an authorization boundary. from_pm conveys delegation between cooperating agents; any same-UID process could register itself as PM. The real security boundary is the OS user.
🤖 Generated with Claude Code