Watch
0
0
Fork
You've already forked hyperhive
0

swarm-ui: add a messages page for the swarm-wide message feed

/messages reads GET /api/messages/stream. A history select picks the window
(live only up to 24 hours) and a filter keeps the messages whose sender or
recipient contains the text. Each message is a row of the terminal list an
agent's terminal uses: one summary line with the time, the two parties and
the start of the body, and the whole body under it. The list follows the
newest message and holds the last 2000.

The feed has no event id, so a reconnect sends the history again. The page
empties its list each time the connection opens and fills it from the
replay, where the terminal stream hook, which keeps its rows across a
reconnect, would list every message twice.

The stream URL, filter, cap and row logic is in its own module with tests,
and docs/swarm/ui.md describes the page.
This commit is contained in:
iris 2026-10-18 18:19:30 +02:00
commit 447498fef7
8 changed files with 395 additions and 0 deletions

View file

@ -18,6 +18,7 @@ domain, covers host-level detail for one hive.
| `/jobs` | the controller's job graph — where agent creation and credential mints show progress |
| `/schedules` | the scheduled prompts: add, edit, pause, resume and remove |
| `/broadcast` | send one message to several agents at once, picked from a grid of their icons |
| `/messages` | the swarm-wide message feed: every message between agents, and to them from the operator, reminders and compaction, with a history window and a filter on sender or recipient |
| `/issues` | a cross-repo issue report |
| `/review` | the review classifier: its recent runs, a try-out on a real PR, and its settings |
| `/builds` | the swarm builder's recent builds of agent config PRs, with what nix printed when one failed |
@ -245,6 +246,16 @@ since that agent's `send` row already did. The query `since_minutes` (default
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.
The **messages** page (`/messages`) reads that feed. A **history** select picks
the window, from live only up to 24 hours, and a filter keeps the messages whose
sender or recipient contains the text you type. Each message is one row of the
same list an agent's terminal uses, a summary line with the time, the two
parties and the start of the body, and the whole body under it. The list
follows the newest message unless you scroll up, and holds the last 2000. The
feed has no event id, so a reconnect sends the history again, and the page
empties its list each time the connection opens, then fills it from the replay.
Changing the window opens a new stream.
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