Native pre-splash for Windows: a borderless layered popup showing
the AgentMux brain logo (pulsing) on a solid dark background while
CefInitialize runs (200β600 ms cold start).
Owns a Windows Job Object handle. CloseHandle on drop. The jobβs
JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE flag means closing the last handle
terminates every assigned process β which is what we want as a backstop
if this launcher dies abruptly.
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).
Home dir without depending on dirs for THIS specific lookup.
Kept to avoid a dirs dep cycle from log() β log() is called from
data_dir::resolve_paths via failure paths, and we want it to work
even if dirs itself is mid-failure.
Find the CEF host binary in the runtime directory.
Tries versioned name first (agentmux-X.Y.Z.exe), then the old
agentmux-cef-X.Y.Z.exe pattern for backwards compat, then plain
agentmux-cef.exe (dev mode).
Process entry point. suppress_os_crash_dialogs() runs FIRST β before the
Tokio runtime is built. The runtime is built explicitly here (rather than
via #[tokio::main], whose generated wrapper would construct it before any
of our code runs) so a fault during runtime construction canβt surface the
Windows crash modal either. Spec:
docs/specs/SPEC_SERVICE_SUPERVISION_AND_RECOVERY_2026_05_20.md.
Show a modal error dialog before the launcher exits. Used for
genuine bind failures (NOT the βalready runningβ path β that
silently forwards via forward_open_new_window). Without this,
the launcher exit is silent (it has the windows subsystem in
release, so eprintln! goes nowhere).
Spawn the CEF host suspended, assign it to the launcherβs Job Object, and
resume it. Returns the running child, or None if any step failed β the
caller decides (fatal on first launch, give-up on a restart). splash_event
is passed on every launch β including restarts β so a relaunched host can
still dismiss a splash left pending by a host that crashed pre-first-frame.
disable_gpu is the retry ladderβs rung-2 degraded mode (spec Β§7): when set
the host is launched with --disable-gpu (software rendering).
Suppress the Windows βApplication Errorβ / WER crash dialog so an unhandled
fault terminates the process immediately instead of wedging it behind a
modal. No-op off Windows. Spec:
docs/specs/SPEC_SERVICE_SUPERVISION_AND_RECOVERY_2026_05_20.md.