fix #289: re-seed forge token in rebuild_agent
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.
This commit is contained in:
parent
2f1b846baf
commit
7ad9809207
1 changed files with 7 additions and 0 deletions
|
|
@ -101,6 +101,13 @@ pub async fn rebuild_agent(coord: &Arc<Coordinator>, 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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue