Skip to main content

Crate agentmux_launcher

Crate agentmux_launcher 

Source

Modulesยง

autostart ๐Ÿ”’
Auto-start-at-login registration โ€” issue #2977 Workstream 2, docs/specs/SPEC_TRAY_OPTIONAL_BACKGROUND_SERVICE_2026_09_04.md ยง4.
background_config ๐Ÿ”’
The tray icon and background-service mode, resolved by the launcher at startup โ€” docs/specs/SPEC_OS_NOTIFICATIONS_SYSTEM_2026_09_24.md ยง4.1.
binary_resolution ๐Ÿ”’
data_dir ๐Ÿ”’
Compatibility shim around agentmux_common::DataPaths.
diag ๐Ÿ”’
event_log ๐Ÿ”’
hash ๐Ÿ”’
host_hang_dump ๐Ÿ”’
SPEC_HOST_UI_THREAD_HANG_WATCHDOG_2026_08_14 ยง1โ€“2 โ€” capture evidence of a wedged host UI thread before anything (a person, usually) kills it.
host_pipe ๐Ÿ”’
host_quit ๐Ÿ”’
Quitting the host: the trayโ€™s โ€œQuit AgentMuxโ€ and the restart into a new version the user agreed to.
host_spawn ๐Ÿ”’
incidents ๐Ÿ”’
The recoveries only the launcher sees, kept for the user (docs/specs/SPEC_RECOVERY_NOTICES_AND_TOASTS_2026_10_16.md ยง4.4, Phase C): the window process restarted after it stopped, with or without graphics acceleration; the background service restarted; and AgentMux giving up.
ipc ๐Ÿ”’
job_object ๐Ÿ”’
lan_firewall ๐Ÿ”’
agentmux.exe --configure-lan-firewall and --remove-lan-firewall: the one elevated step that lets other computers reach AgentMux on Windows (docs/specs/SPEC_LAN_FIREWALL_SETUP_2026_10_01.md 4.1).
launch_link ๐Ÿ”’
A deep link the operating system started the launcher with: a person clicked agentmux://โ€ฆ in a web page, a mail or a chat (docs/specs/SPEC_DEEP_LINKS_ONE_FRAMEWORK_2026_11_20.md R18, G4e; build 4). It is taken out of the arguments the host gets, and handed over once:
logging ๐Ÿ”’
mem_supervisor ๐Ÿ”’
Memory-pressure-aware host supervision โ€” P0 of docs/specs/SPEC_MEMORY_PRESSURE_SUPERVISION_2026_06_16.md.
notify ๐Ÿ”’
OS notification Presenter โ€” docs/specs/SPEC_OS_NOTIFICATIONS_SYSTEM_2026_09_24.md ยง3.2, ยง6.
old_versions ๐Ÿ”’
The old versionsโ€™ files in a setup.exe installโ€™s runtime\ folder.
other_instances ๐Ÿ”’
Read-only detection of OTHER AgentMux (channel, version) instances currently running on this machine, for diagnostic logging ONLY.
quit_ask ๐Ÿ”’
The trayโ€™s Quit asks first when it would stop agents that are working.
reducer ๐Ÿ”’
saga ๐Ÿ”’
second_instance ๐Ÿ”’
splash_config ๐Ÿ”’
โ€œDisable the splashโ€ preference, resolved by the launcher before it spawns the splash (and before the host/srv exist), per SPEC_SPLASH_USERINFO_AND_DISABLE_2026_06_21.md ยง6.
splash_core ๐Ÿ”’
Shared startup-splash timeline logic: the row model, event application with same-tick count-up deferral, a frozen-row finalizer, duration formatting, and total/other reconciliation โ€” used identically by all three platform splash renderers (splash.rs Windows, splash_mac.rs macOS, splash_linux/ Linux).
splash_font ๐Ÿ”’
splash_info ๐Ÿ”’
Identity shown in the splash footer: user@host and v<version> (+ a dev label on non-stable builds). Gathered once in the launcher and handed to each platformโ€™s splash backend, so the three render identical content.
splash_linux ๐Ÿ”’
Session-aware Linux startup splash.
splash_text ๐Ÿ”’
Software text blitter for the splash footer โ€” shared by the Linux software buffers (splash_linux) and the Win32 layered-window DIB (splash.rs). macOS uses native NSTextField instead, so it does not use this module.
srv_spawner ๐Ÿ”’
stale_srv ๐Ÿ”’
Reclaim the data dir from an srv that an earlier launcher left behind.
start_at_login ๐Ÿ”’
app:startatlogin: one setting, three views (docs/specs/SPEC_START_WITH_OS_2026_09_25.md ยง3.9).
startup_events ๐Ÿ”’
Startup event bus: typed events emitted by each launcher startup stage and consumed by the native splash screen renderer.
state ๐Ÿ”’
supervisor ๐Ÿ”’
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.
teardown_backstop ๐Ÿ”’
SPEC_LAUNCHER_TEARDOWN_BACKSTOP_2026_07_11 Phase 2 โ€” the armed J0 teardown state machine.
tray ๐Ÿ”’
Optional system-tray / menu-bar icon โ€” issue #2977 Workstream 1, docs/specs/SPEC_TRAY_OPTIONAL_BACKGROUND_SERVICE_2026_09_04.md.
ui_liveness ๐Ÿ”’
SPEC_LAUNCHER_TEARDOWN_BACKSTOP_2026_07_11 Phase 1 โ€” UI-thread liveness telemetry (observe-only).
updating_window ๐Ÿ”’
The โ€œUpdating to โ€ window of an in-app upgrade that has to stop the running launcher first: a setup.exe install on Windows, a .dmg install on macOS.
upgrade ๐Ÿ”’
quiesce_srv: the launcherโ€™s one way of stopping srv, used on every quit by both supervisors and on โ€œUpgrade & restartโ€. It returns only once the OS has genuinely reaped the process (Child::wait()โ€™s own contract), never after a fixed sleep: data must never change while a srv may still hold it (341faa981โ€™s data-loss incident).
upgrade_linux ๐Ÿ”’
The Linux side of โ€œUpgrade & restartโ€ (docs/specs/SPEC_UPGRADE_FOR_USERS_AND_AGENTS_2026_10_15.md ยง4.2, phase 3e), for upgrade_restart: checking what srv names to start (a portableโ€™s AgentMux/agentmux.sh, or an AppImage), asking the user with zenity or kdialog, and what the new version must not inherit.
upgrade_macos ๐Ÿ”’
The macOS side of โ€œUpgrade & restartโ€ (docs/specs/SPEC_UPGRADE_FOR_USERS_AND_AGENTS_2026_10_15.md ยง4.2, phase 3c), for upgrade_restart: checking the .dmg srv downloaded and verified, asking the user with a native dialog (osascript), and the script that replaces AgentMux.app once this launcher has exited.
upgrade_package ๐Ÿ”’
The launcherโ€™s half of upgrading a .deb or .rpm install from the app (docs/specs/SPEC_LINUX_PACKAGE_UPGRADE_AND_REPOSITORY_2026_10_24.md ยง3.1, phase 3g-1).
upgrade_restart ๐Ÿ”’
โ€œUpgrade & restartโ€ (docs/specs/SPEC_UPGRADE_FOR_USERS_AND_AGENTS_2026_10_15.md ยง4.1, phases 3b, 3c and 3d): restart a Windows portable into the newer release srv downloaded, verified and unpacked next to it, run the newer releaseโ€™s installer on a setup.exe install, or replace a macOS AgentMux.app from the releaseโ€™s .dmg (upgrade_macos; backend/update/download.rs).
verify_update ๐Ÿ”’
agentmux-launcher --verify-update <version> <dir> <file> [installed:<version>] [unreachable:<why>]
version_flag ๐Ÿ”’
agentmux --version (or -V): print the version and exit 0, starting nothing.
wrr ๐Ÿ”’

Functionsยง

launcher_main ๐Ÿ”’
main ๐Ÿ”’
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.
play_selftest_stages ๐Ÿ”’
The fake stages --splash-selftest plays into the splash (prep, migrations with two sub-rows, backend), on the calling thread, with the pauses a real start has. The macOS branch adds the host stage after it.
prune_old_versions_soon ๐Ÿ”’
Start the post-upgrade cleanup: the old runtime\ files and the old per-version data folders, on its own thread so startup is never held up.
show_fatal_dialog ๐Ÿ”’
splash_selftest ๐Ÿ”’
--splash-selftest: show the splash with no srv/host behind it, hold it for a few seconds (or AGENTMUX_SPLASH_HOLD_MS), then exit. A demo/dev affordance for eyeballing the footer + centering without launching the whole app.
suppress_os_crash_dialogs ๐Ÿ”’