From 7ad980920744464abf43cf346e992f40be03238b Mon Sep 17 00:00:00 2001 From: damocles Date: Fri, 22 May 2026 21:51:41 +0200 Subject: [PATCH] fix #289: re-seed forge token in rebuild_agent MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit if forge_after_first_spawn fails transiently on first spawn the token is missing. rebuild_agent now calls ensure_user_for so a manual rebuild (or the startup auto-update scan) recovers the missing token — no full hive reboot needed. --- hive-c0re/src/auto_update.rs | 7 +++++++ 1 file changed, 7 insertions(+) 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