Skip to main content

Module providers

Module providers 

Source
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§

claude
codex
copilot
dsh
gemini
grok
muse
opencode
pi

Structs§

AppServerConfig
Optional App Server capability advertised by a provider. Presence does not select the controller: controller_type remains the rollout switch.
InstructionDirScan
A directory a provider reads instruction files out of.
ProviderConfig
All configuration needed to launch, authenticate, and stream output from a provider CLI.

Enums§

AppServerKind
Protocol spoken by a provider-neutral App Server controller.
ControllerType
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. 0 leaves 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’s TERMINAL_PANE_META is the same.
auto_compact_window
The autoCompactWindow that makes Claude Code compact at compact_at tokens, clamped to the range it accepts; None for 0, which leaves Claude Code’s own.
compact_at_setting
SETTING_COMPACT_AT now, 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 and provider.ensureauthdir.
default_model_for
The model a freshly opened pane of this provider starts on, or None for 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_id cannot start in this build, or None when 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 to retired_reason, not given a message of its own.
install_config
Attach the live settings (bootstrap), so SETTING_COMPACT_AT can be read.
is_known_startup_instructions_filename
Whether path matches ANY registered provider’s startup_instructions_filename — used by the “click Launch” RPC write path (editor_handlers.rs’s WriteAgentConfig handler), 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 dir resolves to provider’s literal ambient home directory (e.g. ~/.claude for 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’s secret_ref.dir set to the literal ambient path — see docs/status/STATUS_IDENTITY_ISOLATION_GATE_NOT_ENFORCING_2026_08_20.md §8), which nothing in the codebase previously validated against. See docs/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 pi installed next to cmd when cmd is pi-acp, for PI_ACP_PI_COMMAND (blockcontroller/acp.rs) and the auth check (run_auth_check). Without it pi-acp runs whatever pi is on PATH, often none (the managed install’s .bin isn’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. None for 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 autoCompactWindow into a config dir’s settings.json from SETTING_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.md into an isolated Claude Code CLAUDE_CONFIG_DIR the first time it’s used, so Claude Code CLI’s own user-level CLAUDE.md discovery always finds something there instead of silently falling through to the operator’s real $HOME/.claude/CLAUDE.md. CLAUDE_CONFIG_DIR relocates credential/ session/project storage but AgentMux never wrote a CLAUDE.md into the relocated dir — verified live on a real machine: 18+ isolated claude config dirs, none with a CLAUDE.md, and a session whose CLAUDE_CONFIG_DIR was a genuinely separate (non-ambient) dir still received the real host file’s contents. See docs/specs/SPEC_ISOLATE_HOST_CLAUDE_MD_2026_08_31.md.
seed_managed_claude_settings
Seeds every Claude setting AgentMux manages into config_dir’s settings.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 cleanupPeriodDays into an isolated Claude Code config dir’s settings.json when 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 --resume nothing to find.
transcript_retention_days
The cleanupPeriodDays AgentMux seeds, from the live settings.
uses_path_cli
provider_id is listed in SETTING_USE_PATH now. Absent: AgentMux’s copy.