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/falsedisables the background check, and it is read before the config so a brokenmagi.tomlcannot 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
cfgconfigures, floored at [MIN_INTERVAL], ordefault_intervalwhen unset or unparsable. - finalize
- Drain a pending check and print at most one line.
- progress_
path - Where
Progressis recorded: besidedaemon.json, not under the cache dir - seeProgress’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.