Skip to main content

Module updater

Module updater 

Source
Expand description

Self-update, via kaishin.

A magi run takes minutes of agent latency, so a background release check costs nothing measurable: it is spawned on the same tokio runtime as the command, overlaps it, and is drained with a bounded wait at shutdown. It never delays the graph.

Structs§

Checker
Throttled release checker.
Progress
One upgrade’s progress, persisted at progress_path.

Enums§

Pending
A background update check, resolved at shutdown.
Stage
How far a self-upgrade this deck set in motion has gotten.

Constants§

NO_AUTOUPDATE_ENV
Env kill-switch. Any non-empty value other than 0 / false disables the background check, and it is read before the config so a broken magi.toml cannot force a network call.

Functions§

default_interval
Default interval between checks.
disabled_by_env
Is the background check switched off by the environment?
effective_interval
The interval cfg configures, floored at [MIN_INTERVAL], or default_interval when unset or unparsable.
finalize
Drain a pending check and print at most one line.
progress_path
Where Progress is recorded: beside daemon.json, not under the cache dir - see Progress’s own doc for why the two are not the same place.
read_progress
The last upgrade this deck recorded, if it has ever started one.
reconcile_after_restart
Reconcile a leftover progress record on startup, before the server starts answering requests.
run_self_update
magi self-update.
spawn
Spawn the background check for cfg, unless it is switched off.
write_progress
Persist progress, atomically.