matrix: provision per-agent accounts on startup via UIAA registration (#548 phase 2)

This commit is contained in:
damocles 2026-05-29 10:46:24 +02:00 committed by Mara
commit 50ceb929d7
4 changed files with 397 additions and 7 deletions

View file

@ -26,6 +26,7 @@ mod scheduled_prompts_worker;
mod limits;
mod loose_ends;
mod manager_server;
mod matrix;
mod meta;
mod migrate;
mod operator_questions;
@ -231,6 +232,14 @@ async fn cmd_serve(
tokio::spawn(async move {
forge::ensure_all().await;
});
// Matrix user sweep: same shape — ensure every container has
// an account on the local matrix-tuwunel homeserver with an
// access_token persisted to `<state>/matrix-token` (#548). No-op
// when the hive-matrix container isn't running. Backgrounded
// because UIAA is a two-roundtrip dance per agent.
tokio::spawn(async move {
matrix::ensure_all().await;
});
// Periodic broker vacuum: drop fully-acked messages older
// than 30 days. Delivered-but-unacked rows (recoverable via
// requeue_inflight) and undelivered rows are always kept.