Expand description
Split out of the single-file bootstrap module unchanged (SPEC_LARGE_FILE_MODULE_ANALYSIS_2026_09_30.md §4.3).
Structs§
- Background
Subsystems - Output of
spawn_background_subsystems— event/watcher infrastructure that needs noAppStateand can start before it is built.
Constants§
- ARCHIVE_
FIRST_ 🔒SWEEP - The session archiver sweeps a minute after srv starts, then hourly. Waiting the full hour first meant an srv restarted more often than hourly never archived anything.
- ARCHIVE_
SWEEP_ 🔒EVERY - FLAG_
LOOK_ 🔒EVERY - How often a flagged pass looks at its flag.
Functions§
- cloud_
subscriber_ 🔒disabled_ from_ env - Should
CloudSubscriber::init_globalbe skipped this run? - deploy_
shell_ 🔒integration - Deploys the shell integration scripts at startup, whichever pane is opened first.
- install_
build_ 🔒slot - Agents’ cargo waits for the host-wide build slot (build_slot.rs).
- move_
voice_ 🔒key_ into_ vault - A Groq key left in settings.json as plain text goes into the Vault, and the setting becomes a
vault:<id>reference (#47636). Decided from the value alone each start, so it runs once in practice and never leaves a marker. In the background: the Vault’s seal key may need the OS keychain. - prune_
stale_ 🔒shell_ integration - Removes the
~/.agentmux/shell/<hash>folders of instances whose data dir is gone. In the background: it reads every instance’s folder listing. Seeshellintegration_prune. - run_
archive_ 🔒sweeps - Run
sweepon the session archiver’s schedule. Never returns. - run_
flagged_ 🔒sweeps - Run
sweepon the archiver’s schedule (a minute after start, then hourly) whileflag_onsays it is on, and also as soon as the flag is turned on: it is looked at every minute (the settings are in memory), and a flag that has gone from off to on since the last look runs the pass then, and the hourly wait starts again from it. A pass whose flag is off is not run; one whose flag stays on is not run twice inside the hour. A pass that is running is not interrupted by a look. Never returns. - set_
up_ 🔒reactive_ handler - Wires the global reactive handler to the controllers and creates its poller.
- skip_
cloud_ 🔒subscriber - Should the boot-time MuxBus reconnect be skipped on this channel?
- spawn_
background_ subsystems - Event infrastructure + all background task spawns that don’t need
AppStateto exist yet: event bus/broker, editor file watcher, config watcher, sysinfo/watchdog/activity loops, the reactive handler + poller, the cloud push subscriber, messaging bridges (Discord/Telegram/Slack/ WhatsApp), docsite dir, messagebus, subagent watcher, history service, and the session archiver. - spawn_
sampling_ 🔒loops - Starts the sampling and watching loops that need no app state.
- start_
cloud_ 🔒services - Starts cloud delivery and the services that follow the account.
- start_
config_ 🔒watchers - Creates the config state and starts the watchers for settings, widgets and the start page.
- start_
history_ 🔒compact_ migration - The reduce pass of the compact-form upgrade (spec section 9): a minute after start, then hourly, and at once
(within a minute) when
history:compactmigrateor its dry run is turned on. Each zone is rewritten beside its old file and swapped in one transaction; a zone that fails a check is left as it was. - start_
provider_ 🔒session_ report - The report-only pass over the provider session files no segment log names (
history:sessionfilereport, off unless set): the sweep’s own owner test and proof, a table of sessions beside the store and one totals line in the log. It removes, imports and locks nothing, and does nothing while the setting is off. - start_
provider_ 🔒session_ sweep - Ends the provider sessions an agent has left or let go idle: proves the history holds what their files hold, then
removes the files by session id. It reads the switch and the idle limit each time and does nothing while the
switch is off (
history:sessionfilesweep, off until the history migration turns it on). - start_
session_ 🔒archiver - Starts the sweeps that archive sessions inactive for a week.
- start_
subagent_ 🔒watcher - Starts the watcher for subagents spawned by Claude Code sessions.
- warm_
agent_ 🔒clis - Installs the pinned CLI of every provider the user’s agents use, in the background.