Skip to main content

Module background

Module background 

Source
Expand description

Split out of the single-file bootstrap module unchanged (SPEC_LARGE_FILE_MODULE_ANALYSIS_2026_09_30.md §4.3).

Structs§

BackgroundSubsystems
Output of spawn_background_subsystems — event/watcher infrastructure that needs no AppState and 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_global be 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. See shellintegration_prune.
run_archive_sweeps 🔒
Run sweep on the session archiver’s schedule. Never returns.
run_flagged_sweeps 🔒
Run sweep on the archiver’s schedule (a minute after start, then hourly) while flag_on says 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 AppState to 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:compactmigrate or 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.