diff --git a/hive-c0re/src/auto_update.rs b/hive-c0re/src/auto_update.rs index f0adae9..3c77db1 100644 --- a/hive-c0re/src/auto_update.rs +++ b/hive-c0re/src/auto_update.rs @@ -101,6 +101,13 @@ pub async fn rebuild_agent(coord: &Arc, name: &str, current_rev: &s sha: None, tag: None, }); + // Re-seed the forge token on every rebuild so a missing + // token (e.g. first-spawn seeding failed transiently) is + // fixed by the next rebuild rather than requiring a full + // hive-c0re restart. + if let Err(e) = crate::forge::ensure_user_for(name).await { + tracing::warn!(%name, error = ?e, "forge: ensure_user after rebuild failed"); + } // Wake the agent on its next turn so claude sees a // "you were rebuilt — check /state/ for notes, --continue // session intact" hint. Covers dashboard rebuild, admin