Watch
0
0
Fork
You've already forked hyperhive
0

the swarm controller streams every inter-agent message from the agents' terminal rows

This commit is contained in:
atlas 2026-10-18 17:27:32 +02:00
commit c32906b893
11 changed files with 520 additions and 12 deletions

View file

@ -233,6 +233,18 @@ whole request and sends nothing when `body` or `agents` is empty, when
`agents` names an agent twice, names more than 64, or names one that
`GET /api/agents` doesn't list.
`GET /api/messages/stream` is an SSE feed of the messages between agents, and
from senders that are no agent (the operator, `reminder`, `compact`) to an
agent. It reads the terminal rows on `$SWARM.term.<agent>` and has no hive in
the path. Each event's `data` is `{ts, from, to, body, body_format?}`. An
agent's `send` row gives one event from that agent to the recipient in the
row's summary. A turn started by a non-agent sender gives one event to the
agent whose terminal holds the row. A turn started by an agent gives none,
since that agent's `send` row already did. The query `since_minutes` (default
60, at most 1440, 0 for live only) sends recent history first, oldest first,
read from each agent's newest 100 rows. A message an agent drained with an
in-turn `recv` starts no turn and so is missing.
A command has its own subject, so the harness never mistakes typed text for
one. `POST /api/agents/<name>/cancel` sends `"cancel"` as a NATS request on
`$SWARM.control.<name>`, and only swarm-controller may publish there. The