Replies: 1 comment
|
Two findings from probing 0.8.0 (protocol 19) that might help shaping this from someone who drives panes the same way, but ended up keeping the unattended half elsewhere. First: the streaming shape you're describing already exists in the binary, just not as a documented verb. Second, concising your #1270 note: the problem isn't only that new subscribers get replay, it's that the envelope has nowhere to put a position. Against the bundled schema, a subscription event is Agreed on the fan-out point, and it's sharper than an ergonomics wart: |
Uh oh!
There was an error while loading. Please reload this page.
Environment: Herdr 0.7.5, protocol 17, macOS (also checked v0.8.0 release notes and
--help— no equivalent verb there either).The need
A steering agent (a Claude/Pi/Codex session in one pane) orchestrates several worker panes. It needs one process it can spawn that blocks and prints one JSON line per lifecycle event across N panes:
The capability already exists — the socket API's
events.subscribeworks fine, verified live on 0.7.5:{ printf '{"id":"sub","method":"events.subscribe","params":{"subscriptions":[{"type":"pane.agent_status_changed","pane_id":"w5:p2"}]}}\n'; sleep 300; } \ | nc -U ~/.config/herdr/herdr.sock # → {"id":"sub","result":{"type":"subscription_started"}}What's missing is a CLI verb wrapping it.
What clients do today
herdr agent wait <target>— one target, one settle, then exit. Watching N workers means N shells or sequential waits.events.subscribe— needs a client that holds a unix-socket connection and parses frames. Shell-based orchestrators end up withnc -Uplus a fixedsleep, which is not a daemon.[[events]]hooks forpane.agent_status_changed/pane.exited/pane.closed/pane.createdand rebuilds the stream as spool files: a process spawn per event, JSONL spools, byte-offset cursors with exclusive locks so concurrent waiters can't rewind each other, an early-crash watchdog, and a follow-daemon mode. That's ~550 lines of userland plumbing (bridge/lifecycle.js+herdr-ping-wait.ts) re-exposing a stream the server already serves on its socket.Suggested shape
A thin
herdr events followthat opensevents.subscribewith the requested filters and prints each event as one JSON line to stdout until killed. Notes from the live check that would shape it:pane.agent_status_changedrequires apane_idper subscription entry (omitting it errorsmissing field pane_id), so the verb would fan--paneflags into N entries — workable, though a workspace-wide or wildcard filter would be nicer for orchestrators whose pane set changes mid-run.No new event types, no completion classification — transport ergonomics only. Every agent-orchestration stack on top of Herdr needs this loop, and today each one rebuilds it.
All reactions