Expand description
“Upgrade & restart”, srv’s half
(docs/specs/SPEC_UPGRADE_FOR_USERS_AND_AGENTS_2026_10_15.md §4.1, §8.2,
phase 3b).
Once a release is staged (update::download), a restart that is decided (the user’s click or own turn, or
an approved request whose in-app countdown ran out with no veto) waits for
every agent to finish its turn (for as long as that takes, with who is
waited for read again every pass; “Now” skips the wait, and Cancel stops
it), then srv asks the launcher to restart into the new
version with an AGENTMUXSRV-UPGRADE ... confirmed:1 line on its stderr. The launcher
checks the folder and the release’s digest again and, the restart being decided, restarts
without asking again (crates/launcher/src/upgrade_restart.rs); restarting can’t be
cancelled from here. If nothing has happened three
minutes later (the launcher refused the file, or an AgentMux that can’t restart itself, or a
prompt it still had to show was declined), the
status goes back to ready and says so: when and why the restart wasn’t
confirmed (not_confirmed_at, not_confirmed), and the agents that asked
are told. The launcher says why in its answer file and its own log.
What the wait is for, and nothing else: an agent whose process is alive
and which is in the middle of a turn ([busy_controllers]). A turn held
up by a request that is being retried is still a turn, and the status says
so, since such a wait can be long. What agents left running in the
background is not waited for: it is listed, and the restart stops it.
With nobody to wait for the state is restarting at once: waiting
always names at least one agent.
Every change of state happens under [RUN], checked against the run it
belongs to, so a Cancel can never be overtaken by a run it stopped.
Functions§
- cancel
- Stop waiting (the user’s Cancel, through the host). Once the launcher is asked, the restart has started and can’t be cancelled here.
- start
- Start “Upgrade & restart”.
askersare the panes of the agents that asked for it: they are told if the restart is not confirmed (the user’s own click has none). - stopping_
now - [
stopping] off the async threads.