| Filename | Latest commit message | Latest commit date |
|---|---|---|
The daemon's two-minute refresh compared the store's linked account names with the names it booted with. A secondary that was named but did not come up - no token at bring-up, a token the homeserver rejected (M_UNKNOWN_TOKEN), or a homeserver still down after the ~52 s boot retries - kept its name in the set, so nothing ever noticed it again: it stayed down until the daemon restarted for some other reason, and an operator re-linking a rejected account changed no name. Each such secondary is now tried again on the same two-minute period, one per tick, after one refresh and then doubling waits capped at sixteen minutes. One that comes up joins the registry (now behind a lock) and its sync loop joins the running set; the primary and the other accounts are not restarted. The store is still only read. The startup todo wipe moves out of bring_up_account to run once before any sync loop: run per account, a late secondary would have cleared the todos the running accounts' sweeps had already deduped. Part of #5017 (slice M). |
||
| .. | ||
| src | ||
| Cargo.toml | ||
| README.md | ||
hive-matrix-mcp
Per-agent matrix integration: a long-running daemon
(hive-matrix-daemon) that holds a matrix-sdk Client + sync loop per
configured account and serves the matrix tool surface (send_message,
send_dm, list_rooms, read_room, …) directly over streamable-http.
No stdio bridge, no per-turn respawn — claude reconnects to the same
stable URL every turn.
When to use it
Look here when changing matrix tool behaviour, multi-account handling,
or the incoming-event → todo/wake path. The daemon owns the whole
lifecycle: per-account bring-up (accounts.rs, client.rs), the sync
loop that sweeps invites/unread rooms into the harness's in-agent todo
socket (timeline.rs, wake.rs), and the MCP tool router itself
(mcp.rs).
Shape
One bin (hive-matrix-daemon, src/main.rs) built from the crate's
own lib (src/lib.rs):
accounts.rs— multi-account config + the account→Clientdispatch registry (mainis always the hive-internal primary; extras come fromHIVE_MATRIX_ACCOUNTS).client.rs— session restore, stale-token recovery, avatar sync, cross-signing bootstrap.timeline.rs/wake.rs— per-sync-callback invite/unread sweeps that push todos ontoHIVE_AGENT_SOCKET.handlers.rs— per-tool dispatch, returnsprotocol::DaemonResponse.mcp.rs— thermcptool router +serve_http, resolving each call's optionalaccountarg against the registry before calling intohandlers.paths.rs— per-agent path resolution (token file, matrix-sdk state dir, homeserver URL, accounts snapshot).