| Filename | Latest commit message | Latest commit date |
|---|---|---|
The startup todo wipe runs once in main, before any sync loop, so a secondary that comes up later cannot clear the todos the running accounts' sweeps already deduped. Nothing tested that. main now reads HIVE_AGENT_SOCKET once at startup and hands the path to wake::clear_all_todos, the only way left to wipe the whole set; send_todo_clear clears one key only. bring_up_account is split into restore_account (everything that talks to the network) and the synchronous account_sync_loop, and the retry path restores with the former and builds the loop itself. Neither the loop nor the retry path is given the socket. The new test runs a late secondary's retry and its sync loop against a listener standing in for the harness socket, after startup's wipe, and asserts the harness saw exactly one wipe. It pins that seam, not every place in restore_account a wipe could be added. |
||
| .. | ||
| 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).