Expand description
Runtime mode detection — single source of truth.
The launcher computes RuntimeMode::current once at startup and
propagates the result to host + srv via the AGENTMUX_RUNTIME_MODE
environment variable. No binary should call [current] more than
once per process; downstream binaries read the env var via
[from_env] instead.
Replaces the legacy mix of cfg!(debug_assertions), env::var ("AGENTMUX_DEV").is_ok(), and == Ok("1") checks across launcher,
host, and sidecar — which were each correct in isolation but
desynchronized in combination (see docs/specs/
SPEC_DATA_DIR_UNIFICATION_2026-05-05.md §2.1).
§Detection priority
AGENTMUX_RUNTIME_MODEenv override (testing, CI).- Marker-based portable detection:
<exe-dir>/agentmux-portable.markerexists (also looks two levels up for macOS .app bundles). Written byscripts/package-portable.shat packaging time (see theprintf '...' > "$PORTABLE/agentmux-portable.marker"line). - Path-based dev detection: exe is under a known dev-build dir
(
dist/cef-dev/,target/debug/,target/release/). AGENTMUX_DEV_BRANCHenv override (CI override for dev mode).- Default:
Installed.
Enums§
- Runtime
Mode - Where this AgentMux binary is running from. Determines data path
layout (see
crate::DataPaths).
Functions§
- is_
dev_ build_ exe - True when this binary is running from one of our known dev-build
output directories (
dist/cef-dev/,target/debug/,target/release/). Walks ancestors to handle nested cases (CEF subprocesses run from aruntime/subdir even in dev). Path-only — does not read env.