diff --git a/hive-matrix-mcp/src/client.rs b/hive-matrix-mcp/src/client.rs index 41121b7a..1db66db4 100644 --- a/hive-matrix-mcp/src/client.rs +++ b/hive-matrix-mcp/src/client.rs @@ -84,6 +84,12 @@ pub async fn build_and_restore( "failed to remove sdk state dir; next startup may fail with stale state" ); } + // Exit 0 rather than returning Err: `hive-matrix-daemon` is a + // single-purpose process binary; the call site is before any + // tasks are spawned so there are no resources to clean up. + // Using exit(0) (not Err) keeps systemd's Restart=on-failure + // from looping — the systemd.paths watcher re-launches us + // once hive-c0re writes a fresh token file. std::process::exit(0); } return Err(e);