Skip to main content

Module upgrade_request

Module upgrade_request 

Source
Expand description

An agent asking to upgrade AgentMux: RequestUpgrade (docs/specs/SPEC_UPGRADE_FOR_USERS_AND_AGENTS_2026_10_15.md §5.1, phase 4).

A restart stops every agent and interrupts the user, and an agent can be prompt-injected, so an agent’s word alone never starts one:

  • the user’s own turn asked for it (self_quit::gate_upgrade: as for QuitSelf, but a Swarm broadcast doesn’t count): the upgrade starts — the release is downloaded if it isn’t yet, then AgentMux restarts once every agent has finished its turn;
  • anything else is a sensitive request (server/sensitive_handlers.rs): the super agent decides, the person can veto the countdown, and the agent is told each step as an [AgentMux] note. When the countdown ends, sagas/sensitive_runners.rs starts the same upgrade.

The prompt every window used to show for the second case is gone; answer, list and UpgradeRequest below only serve any left from before.

Either way the restart is already decided by then, so the launcher asks nothing more (crates/launcher/src/upgrade_restart.rs), and only a release the update check found, verified against GitHub’s checksum, is installed: the agent can’t name a file or a URL.

Structs§

UpgradeRequest
An agent’s request waiting for the user.
UpgradeRequestAnswer
The user’s answer, relayed by the host (POST /api/v1/host/upgrade_request).
UpgradeRequestsEvent
app:upgraderequests: the agents’ upgrade requests waiting for the user.

Enums§

Outcome
What RequestUpgrade answers the agent.

Functions§

answer
The user’s answer to request id, for the release the prompt showed (relayed by the host: POST /api/v1/host/upgrade_request). Upgrade now answers every request for that release, since there is one AgentMux to upgrade; if the update check has found a newer release since, it installs nothing and the agent is told to ask again.
installable
The release a request may install, or why there is none. wanted is the version the agent named, if any: only the latest release can be installed.
list
The requests waiting for the user (app.upgrade-requests).
resolve_started
The user’s own turn started the upgrade to version: requests for it that were waiting are answered by that, and their agents told so.
start_upgrade
Download version if it isn’t yet, then restart once every agent has finished its turn (the restart is already decided, so the launcher asks nothing more). Only while version is still the latest release: the download and restart take the latest, so a newer one appearing meanwhile stops the flow. The agents in askers (their panes) are told if it stops short, and why.