Skip to main content

resolve_settings_dir

Function resolve_settings_dir 

Source
pub fn resolve_settings_dir() -> PathBuf
Expand description

Resolve the directory containing settings.json.

Priority:

  1. AGENTMUX_SETTINGS_DIR env var (set by the host app to its config dir)
  2. If agentmux_common::isolated_settings_enabled — the default for every channel except stable, see docs/specs/SPEC_SETTINGS_ISOLATED_BY_CHANNEL_2026_08_19.md — AGENTMUX_CONFIG_HOME used DIRECTLY, with no parent-walk. That var already carries the correctly channel-scoped channels/<ch>/config/ directory (re-exported from AGENTMUX_CONFIG_DIR, see data_paths.rs’s own channels/<ch>/config/ ← settings (channel-wide) layout comment) — this is the fix, using that value as-is instead of walking past it.
  3. Otherwise (global — stable channel, or an explicit AGENTMUX_ISOLATED_SETTINGS=0 opt-out): AGENTMUX_CONFIG_HOME, walking up two parent directories — unchanged legacy behavior. That var’s value is a channel-scoped .../config directory; walking up two levels lands one level ABOVE the channel root (on ~/.agentmux/channels/ itself, not inside any specific channel), which is what makes this the genuinely shared, cross-channel file.
  4. ~/.agentmux (legacy fallback — AGENTMUX_CONFIG_HOME unset)