Expand description
Static provider registry — Rust equivalent of
frontend/app/view/agent/providers/index.ts.
All string data is &'static str / &'static [&'static str] so lookups
are zero-allocation. The registry is initialised once via LazyLock and
then read-only for the lifetime of the process.
Structs§
- AppServer
Config - Optional App Server capability advertised by a provider. Presence does not
select the controller:
controller_typeremains the rollout switch. - Instruction
DirScan - A directory a provider reads instruction files out of.
- Provider
Config - All configuration needed to launch, authenticate, and stream output from a provider CLI.
Enums§
- AppServer
Kind - Protocol spoken by a provider-neutral App Server controller.
- Controller
Type - How the provider process is managed.
Constants§
- CLAUDE_
MD_ 🔒ISOLATION_ PLACEHOLDER - Placeholder written by
seed_claude_md_placeholder_if_missing— explains itself so an operator who opens the file isn’t confused by an unexplained empty one. - CLAUDE_
TRANSCRIPT_ RETENTION_ DAYS - Days Claude Code keeps session transcripts in an AgentMux-owned config dir (SPEC_DURABLE_CONVERSATION_MEMORY_2026_09_23.md §4.1).
Statics§
- ALIASES 🔒
- ANTIGRAVITY 🔒
- CLAUDE 🔒
- CODEX 🔒
- COPILOT 🔒
- GEMINI 🔒
- KIMI 🔒
- MUX_
CODE 🔒 - OPENCLAW 🔒
- PI 🔒
- QWEN 🔒
- REGISTRY 🔒
Functions§
- all_
providers - Every registered provider, for callers that must act on all of them
rather than look one up by id — e.g. a migration backfilling
conversation history for every provider that has a linkable native
history directory (
ProviderConfig::history_native_subdir), so a future provider gains that behavior automatically instead of needing a follow-up patch to an id list maintained elsewhere. - antigravity_
install_ 🔒paths %LOCALAPPDATA%\agy\bin\agy.exeon Windows and~/.local/bin/agyelsewhere: the defaultTARGET_DIRof Google’s installers, https://antigravity.google/cli/install.ps1 and the.shone beside it.- default_
auth_ dir provider’s DEFAULT auth/config dir:~/.agentmux/shared/providers/<auth_dir_name>/— account-wide and version/channel-independent, so one login is shared by every instance (the structural fix for the per-channel validate-spin regression). A per-account auth dir (identity_handlers) still wins for explicit multi-account. Shared by agent open andprovider.ensureauthdir.- default_
model_ for - The model a freshly opened pane of this provider starts on, or
Nonefor a provider whose model the runtime menu does not wire (it passes no--model). - get_
provider - Look up a provider by canonical ID or alias.
- is_
known_ startup_ instructions_ filename - Whether
pathmatches ANY registered provider’sstartup_instructions_filename— used by the “click Launch” RPC write path (editor_handlers.rs’sWriteAgentConfighandler), which receives an already-built file list from the frontend with no accompanying provider ID, so it can’t otherwise tell “this is the startup instructions file” from “this is some other config file” without either re-deriving the mapping itself (drift risk) or checking membership here (single source of truth). See docs/specs/SPEC_PROVIDER_AWARE_STARTUP_INSTRUCTIONS_2026_08_24.md §3. - is_
pi_ acp - Whether
cmd(a path or bare name) is the pi-acp adapter. - is_
provider_ ambient_ home_ dir - True when
dirresolves toprovider’s literal ambient home directory (e.g.~/.claudefor Claude Code) rather than an AgentMux-isolated dir. Used to block identity bindings/spawns from ever pointing a spawned agent at the operator’s own global CLI login — a real, currently-live instance of exactly this was found in this repo’s own data (an account’ssecret_ref.dirset to the literal ambient path — seedocs/status/STATUS_IDENTITY_ISOLATION_GATE_NOT_ENFORCING_2026_08_20.md§8), which nothing in the codebase previously validated against. Seedocs/specs/SPEC_BLOCK_AMBIENT_HOME_DIR_IDENTITY_BINDING_2026_08_25.md. - known_
install_ paths - Where a PATH-only provider’s own installer puts its CLI, for the case where that folder is not on this process’s PATH yet. Antigravity’s installer adds its folder to the user’s PATH, but an AgentMux that is already running keeps the PATH it started with, so without this the CLI would read as missing until AgentMux restarts.
- normalize_
path_ 🔒lexically - Lexically normalizes a path with NO filesystem access (unlike
canonicalize, safe to call on a path that doesn’t exist). Collapses.and..components (codex P1, PR #2802: without this, a not-yet- created dir like$HOME/.claude/.compared unequal to$HOME/.claudeunder plain string comparison, bypassing the guard entirely on a fresh machine — a..segment is normalized the same way for the same reason). Never pops past a root/prefix/leading..— a leading..with nothing to cancel stays literal, standard lexical-normalization semantics. - paths_
resolve_ 🔒to_ same_ dir - The actual comparison, split out with the reference side pre-resolved
(not calling
get_home_dir()internally) so it’s directly testable against a tempdir instead of the real$HOME/%USERPROFILE%— same “inject the path, don’t resolve it internally” patternread_claude_global_configalready uses (agent_handlers/bundle.rs). - pi_
beside_ pi_ acp - The
piinstalled next tocmdwhencmdis pi-acp, forPI_ACP_PI_COMMAND(blockcontroller/acp.rs) and the auth check (run_auth_check). Without it pi-acp runs whateverpiis on PATH, often none (the managed install’s.binisn’t on PATH) or an older one. SPEC_PI_HARNESS_VIA_PI_ACP_2026_10_06.md. - prepare_
provider_ auth_ dir - Prepare an isolated provider auth/config directory for use as
CLAUDE_CONFIG_DIR(or a provider’s equivalent): create it, then apply every isolation guarantee that directory needs before a CLI is pointed at it. - resolve_
provider_ alias - Resolve a provider alias to its canonical ID.
- seed_
claude_ md_ placeholder_ if_ missing - Seeds an empty placeholder
CLAUDE.mdinto an isolated Claude CodeCLAUDE_CONFIG_DIRthe first time it’s used, so Claude Code CLI’s own user-levelCLAUDE.mddiscovery always finds something there instead of silently falling through to the operator’s real$HOME/.claude/CLAUDE.md.CLAUDE_CONFIG_DIRrelocates credential/ session/project storage but AgentMux never wrote aCLAUDE.mdinto the relocated dir — verified live on a real machine: 18+ isolatedclaudeconfig dirs, none with aCLAUDE.md, and a session whoseCLAUDE_CONFIG_DIRwas a genuinely separate (non-ambient) dir still received the real host file’s contents. Seedocs/specs/SPEC_ISOLATE_HOST_CLAUDE_MD_2026_08_31.md. - seed_
transcript_ retention_ if_ missing - Seeds
cleanupPeriodDaysinto an isolated Claude Code config dir’ssettings.jsonwhen it isn’t set. Claude Code’s default is 30 days, and its startup sweep deletes transcripts under<config_dir>/projects, which AgentMux junctions to the account’s shared history — so any channel that launched an agent without this setting deleted every channel’s month-old conversations, leaving--resumenothing to find.