Watch
0
0
Fork
You've already forked hyperhive
0

swarm-controller: retry the legacy forge token sweep from the mint pass

The sweep ran once at startup and was never retried: a boot where
store::connect or the roster read failed (e.g. the controller up
before bao) left the tokens live until the next restart. It now runs
off forge::agent_token::spawn's five-minute mint pass, reusing that
pass's roster observation instead of a second store/roster read, so a
failed first tick retries on the next one. Idempotent, so a re-run
after a partial sweep deletes nothing extra. Drops the one-shot
startup spawn; one call path.

Also updates the forge.md and agent_token.rs docs that still said the
legacy hyperhive-<seconds> tokens stay until manually removed.

Refs #4644
This commit is contained in:
atlas 2026-09-29 20:11:06 +02:00 • committed by mara
commit e9206505d4
4 changed files with 36 additions and 67 deletions

View file

@ -2158,9 +2158,10 @@ fn spawn_matrix_account_backfill(
});
}
/// Start the forge's periodic passes — the swarm-wide objects and agents'
/// tokens — and the one-shot legacy token sweep, when a forge is configured.
/// Lifted out of `main` for `clippy::too_many_lines`.
/// Start the forge's periodic passes — the swarm-wide objects, and agents'
/// tokens (which also sweeps legacy tokens; see `forge::legacy_tokens`) —
/// when a forge is configured. Lifted out of `main` for
/// `clippy::too_many_lines`.
fn spawn_forge_workers(
jobq: &Arc<Mutex<hive_jobq::scheduler::Scheduler<SwarmNodeKind, SwarmResourceKind>>>,
forge_client: Option<Arc<forge::Client>>,
@ -2169,7 +2170,6 @@ fn spawn_forge_workers(
return;
};
forge::objects::spawn(Arc::clone(&client));
forge::legacy_tokens::spawn(Arc::clone(&client));
let sched = Arc::clone(jobq);
forge::agent_token::spawn(client, move |agents| {
if let Err(e) = queue_forge_token_mints(&sched, agents) {