hive-matrix-mcp: sync with sliding sync when the server has it, classic /sync otherwise
This commit is contained in:
parent
24c5c02942
commit
c41429e473
1 changed files with 198 additions and 15 deletions
|
|
@ -115,6 +115,20 @@ Silently exits when the primary account has no token yet; the
|
|||
appears, and, on an agent with a store, a timer restarts it while it's
|
||||
down so it re-reads a token the swarm minted into the store.
|
||||
|
||||
**Sync protocol**: when the homeserver advertises sliding sync (MSC4186,
|
||||
`org.matrix.simplified_msc3575` in `/versions`) the daemon uses it: one
|
||||
growing list over every joined room, the newest event per room and only
|
||||
the state it reads (name, alias, encryption, create, power levels, lazy
|
||||
members), plus the receipts, to-device, E2EE and account-data extensions.
|
||||
That's the protocol Element X uses, and it moves far fewer bytes than
|
||||
classic `/sync`. A server without it gets classic `/sync` with a trimmed
|
||||
filter (no presence or typing, lazy-loaded members, 20-event timelines).
|
||||
After 5 failed sliding-sync polls in a row the daemon also falls back to
|
||||
`/sync`. Set `HIVE_MATRIX_SYNC=classic` in the daemon's environment to
|
||||
force `/sync`. The unread check doesn't depend on the protocol: it reads
|
||||
the agent's own receipt from the store and the recent events with a live
|
||||
`/messages` call.
|
||||
|
||||
**Wake path**: after every sync the daemon upserts a harness-local todo
|
||||
on the in-agent socket for each unread room (keyed by its room id) and
|
||||
each pending invite (below). A new or changed todo wakes the agent with
|
||||
|
|
|
|||
Loading…
Reference in a new issue