Expand description
Platform host-supervision loops. The Windows and Unix supervisors are
fully #[cfg]-gated in separate files; only the flow spine
(launcher_main) lives at the crate root.
Modulesยง
- srv_
exit ๐ - What the Unix supervisor does when srv exits: classify the exit, and start
srv again (SPEC_UNIX_SRV_RESTART_BUDGET_2026_10_24). The Windows supervisor
does the same inline in
run_windowsโs srv arm. - unix ๐
Constantsยง
- HOST_
RESTART_ ๐BUDGET - Phase 1 host supervision (spec
docs/specs/SPEC_SERVICE_SUPERVISION_AND_RECOVERY_2026_05_20.md): on an abnormal host exit the launcher relaunches the host, but at mostHOST_RESTART_BUDGETtimes withinHOST_RESTART_WINDOWโ a crash budget so a deterministic crash cannot spin forever (spec ยง10-A). Shared by the Windows (run_windows) and Unix (run_unix) supervisors. - HOST_
RESTART_ ๐WINDOW - SRV_
RESTART_ ๐BUDGET - SPEC_SRV_SUPERVISION_RECYCLE_2026_07_11 (#942 Phase 2) โ srv gets its own crash budget: an unexpected srv exit respawns srv and recycles the host through the existing supervised-restart path (crash-reproject restores the session), at most this many times per window. A wider window than the hostโs: each srv recycle also costs a host restart, so a crash-looping srv burns both budgets and gives up loudly either way.
- SRV_
RESTART_ ๐WINDOW - STATUS_
CONTROL_ ๐C_ EXIT STATUS_CONTROL_C_EXIT: the console interrupted the process (Ctrl+C or a close) โ a shutdown, not a fault, whatever its NTSTATUS-looking value.
Functionsยง
- final_
host_ ๐exit_ line - The log line for a host exit that ends the launcher without a relaunch: a clean exit, or the stop for a blocked sandbox (#610), which says why where the person or agent reading this log looks.
- is_
fault_ ๐code - Whether an exit code is cast as a Windows fault: an NTSTATUS exception
(negative as
i32), except the consoleโs own control-C exit. - is_
sandbox_ ๐unavailable_ exit - Whether a host exit is the one that says โthe browser sandbox is blocked by system policy and nobody can answer
the dialogโ (
agentmux_common::process::HOST_EXIT_SANDBOX_UNAVAILABLE, set byagentmux-ceffor a start made from an agentโs environment). The same stop would come again at every relaunch, so the supervisor ends with that code at once instead of spending its crash budget on it. - repeats_
crash ๐ - Whether this abnormal host exit repeats the previous one closely enough to
be the same fault twice in a row โ what the retry ladder answers with
--disable-gpu(issue #3666).