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.
Modules§
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.
- Tier
- How far AgentMux stands behind a harness: the lab’s own door (
FirstClass), or one that is installable and works but is not promised (Preview). It decides the picker, the defaults and the docs, and nothing about containers. An agent already running a preview harness is unaffected.
Constants§
- CLAUDE_
TRANSCRIPT_ RETENTION_ DAYS - Days Claude Code keeps session transcripts in an AgentMux-owned config dir: forever. 36500 days (100 years) is the most Claude Code accepts, and larger values are rejected. Never 0, which deletes a transcript when its session ends.
- DEFAULT_
COMPACT_ AT - SETTING_
COMPACT_ AT agent:compactat: the context size, in tokens, at which Claude agents auto-compact.0leaves Claude Code’s own point (the window minus 33K, about 967K on a 1M window).docs/specs/SPEC_AGENT_SELF_COMPACTION_2026_10_23.md§3.1.- SETTING_
USE_ PATH cli:usepath: the ids of the providers whose CLI is the person’s own copy on PATH, not AgentMux’s (SPEC_ISOLATED_INSTALL_FOR_NON_NPM_CLIS_2026_11_05.md §3).
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. - apply_
terminal_ pane_ meta - A terminal-tier provider’s pane (
agent.open): a terminal running the CLI’s own UI, started at once. The frontend’sTERMINAL_PANE_METAis the same. - auto_
compact_ window - The
autoCompactWindowthat makes Claude Code compact atcompact_attokens, clamped to the range it accepts;Nonefor0, which leaves Claude Code’s own. - compact_
at_ setting SETTING_COMPACT_ATnow, or its default.- 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.
- harness_
unusable_ reason - Why an agent that names
provider_idcannot start in this build, orNonewhen the harness is here. A harness AgentMux retired gives its own sentence (retired_reason); any other that is not here (an agent written by a newer AgentMux, or a harness taken out) says so. Either way the agent is kept with its history, and can be changed to another harness or deleted. This is the one place a removed harness is said: a harness that is taken out is added toretired_reason, not given a message of its own. - install_
config - Attach the live settings (bootstrap), so
SETTING_COMPACT_ATcan be read. - 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. A provider’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.
- live_
setting_ str - A string setting now, when it is set and not empty.
- 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.
- retired_
reason - A harness AgentMux no longer offers, with the one sentence an agent that used it is told. Such an agent is kept (its
definition and history stay) and does not start; a pane that is still running it is refused at its next turn.
Nonefor every provider that is offered. Antigravity: Google’s terms do not allow third-party tools on its login, and an account that does it can be suspended. The nine removed for the beta (Aider, Cline, Crush, Goose, Kilo, Kimi, MuxCode, OpenClaw, Qwen Code) are narrowed to the harnesses AgentMux keeps working. - retired_
reason_ for_ output_ format - What a pane that used a retired harness is told, by the output format it was opened with. Panes record that format
at launch (
agentOutputFormat), so a pane restored from before the harness was removed is recognised without its definition. Only a format that one harness alone wrote can say so: the formats Aider, Cline, Crush, Goose, Kilo, MuxCode and OpenClaw wrote (raw,acp,claude-stream-json) are shared with harnesses that are offered. - seed_
auto_ compact_ window - Seeds Claude Code’s
autoCompactWindowinto a config dir’ssettings.jsonfromSETTING_COMPACT_AT(compact_at), so agents compact at that size instead of near a full 1M window. - 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_
managed_ claude_ settings - Seeds every Claude setting AgentMux manages into
config_dir’ssettings.json: transcript retention and the auto-compact window, and the Explore sub-agent’s model. Each soft-fails on its own; returns what couldn’t be written, and why. - 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. - transcript_
retention_ days - The
cleanupPeriodDaysAgentMux seeds, from the live settings. - uses_
path_ cli provider_idis listed inSETTING_USE_PATHnow. Absent: AgentMux’s copy.