hive-matrix-mcp: read the main account's token from the store too
The daemon reads each account's token from `swarm/agents/<agent>/matrix/` as the agent itself, inside its own container, and falls back to the file only when the store has none. This is #4519's read, without its `main` carve-out: the swarm now mints `main` there and no hive writes the file. The daemon unit gets the agent's store identity, spelled the way forge-token.nix spells it. A timer re-starts it while it is down: a token the swarm mints or replaces in the store changes no file, so the path watcher never fires for it, and a daemon that exited on a replaced token would otherwise stay down until the container restarts.
This commit is contained in:
parent
2776e121e5
commit
ab153bda2f
9 changed files with 670 additions and 85 deletions
|
|
@ -8,8 +8,8 @@ use std::path::PathBuf;
|
|||
|
||||
/// Resolve the matrix access-token file path. Override via
|
||||
/// `HIVE_MATRIX_TOKEN_FILE`; default is `<HYPERHIVE_STATE_DIR>/matrix-token`,
|
||||
/// the path `hive-c0re::matrix::ensure_user_for` writes to on agent
|
||||
/// account provisioning.
|
||||
/// where a hive used to write the `main` account's token (the daemon now reads
|
||||
/// it from the store first; see `main.rs`'s `account_token`).
|
||||
#[must_use]
|
||||
pub fn token_file() -> PathBuf {
|
||||
if let Some(p) = std::env::var_os("HIVE_MATRIX_TOKEN_FILE") {
|
||||
|
|
|
|||
Loading…
Reference in a new issue