Skip to main content

Module supervisor

Module supervisor 

Source
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 most HOST_RESTART_BUDGET times within HOST_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 by agentmux-cef for 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).