pub struct ProviderConfig {Show 21 fields
pub id: &'static str,
pub cli_command: &'static str,
pub controller_type: ControllerType,
pub app_server: Option<AppServerConfig>,
pub launch_args: &'static [&'static str],
pub persistent_launch_args: Option<&'static [&'static str]>,
pub resume_flag: Option<&'static str>,
pub session_id_field: &'static str,
pub styled_output_format: &'static str,
pub auth_config_dir_env_var: &'static str,
pub auth_dir_name: &'static str,
pub history_native_subdir: Option<&'static str>,
pub auth_extra_env: &'static [(&'static str, &'static str)],
pub unset_env: &'static [&'static str],
pub npm_package: &'static str,
pub pinned_version: &'static str,
pub base_url_env_var: Option<&'static str>,
pub supported_vendors: &'static [&'static str],
pub startup_instructions_filename: Option<&'static str>,
pub native_instruction_sources: &'static [&'static str],
pub native_instruction_dirs: &'static [InstructionDirScan],
}Expand description
All configuration needed to launch, authenticate, and stream output from a provider CLI.
Fields§
§id: &'static strCanonical provider identifier (e.g. "claude").
cli_command: &'static strExecutable name on PATH (e.g. "claude").
controller_type: ControllerTypeWhether the provider keeps a persistent subprocess or spawns per turn.
app_server: Option<AppServerConfig>Rich-client App Server capability, when the provider exposes one.
Kept separate from controller_type so the transport can land behind a
disabled-by-default rollout gate.
launch_args: &'static [&'static str]Complete CLI args for a single-turn (subprocess) invocation. The user prompt is written to the process’s stdin.
persistent_launch_args: Option<&'static [&'static str]>CLI args for persistent (long-running) mode.
None when controller_type is Subprocess.
resume_flag: Option<&'static str>Flag passed to resume a prior session, e.g. "--resume".
None when the provider does not support simple-flag resume.
session_id_field: &'static strJSON field name in the CLI’s init event that carries the session /
thread ID, e.g. "session_id" or "thread_id".
styled_output_format: &'static strOutput format produced by the CLI in styled / streaming mode.
auth_config_dir_env_var: &'static strEnvironment variable that redirects the provider’s config / auth
directory, e.g. "CLAUDE_CONFIG_DIR".
auth_dir_name: &'static strSub-directory name for this provider’s auth/config dir, e.g. "claude".
Resolved under shared/providers/<name>/ (the default, account-wide and
instance-independent) and shared/identities/<bundle>/<name>/ (per-identity)
— see DataPaths::provider_auth_dir and identity_dir.
history_native_subdir: Option<&'static str>Sub-directory (relative to this provider’s config/auth dir) that
actually holds its native session/transcript history — e.g.
Claude’s "projects", Codex’s "sessions", Gemini’s "history".
None for providers with no simple directory-based history to
isolate/link (ACP providers — openclaw/pi/copilot — expose history
through the live protocol stream instead, not a fixed on-disk
path). Per-provider, filesystem-verified table:
docs/specs/SPEC_UNIFIED_AGENT_HISTORY_STORE_2026-06-10.md §2.1.
Used by identity_auth_dirs.rs to redirect an isolated identity’s
history to the always-global
DataPaths::identity_history_dir — reagentx P1 on PR #2605 caught
that hardcoding "projects" there only worked for claude,
silently leaving every other OAuth-class provider’s history
channel-local and unlinked.
auth_extra_env: &'static [(&'static str, &'static str)]Extra environment variables required for auth isolation.
Each entry is a (key, value) pair.
unset_env: &'static [&'static str]Environment variables that must be unset before launching the CLI (guards against nested-session issues, etc.).
npm_package: &'static strnpm package name used for local installation, e.g.
"@anthropic-ai/claude-code".
pinned_version: &'static strVersion string passed to npm install, e.g. "latest" or "0.116.0".
base_url_env_var: Option<&'static str>Environment variable this harness reads to redirect its model vendor
backend (e.g. Claude Code’s ANTHROPIC_BASE_URL, pointing it at a
proxy/Bedrock/OpenRouter instead of Anthropic’s default endpoint).
None when a harness isn’t confirmed to support redirection — the
harness (CLI driving the session) and the model vendor (LLM backend
actually serving responses) are independent dimensions; this is the
declared capability side of that split. Set only where independently
verified, not guessed. See docs/specs for the harness/vendor concept.
supported_vendors: &'static [&'static str]Intelligence model vendors this harness talks to, most-default-first
(e.g. claude → &["anthropic"], openclaw → &["openai", "anthropic", "google"] since it’s model-agnostic). Purely descriptive/display
data — drives the dual-icon vendor badge and the picker’s default
vendor inference (resolveEffectiveVendor on the frontend); does not
gate anything at spawn time. The one thing that DOES gate spawn-time
behavior is base_url_env_var above — a provider can be redirected
to a custom endpoint independent of whether that endpoint’s vendor
is even listed here.
startup_instructions_filename: Option<&'static str>Path (relative to the agent’s working directory) this provider
natively auto-discovers its startup instructions from — e.g.
"CLAUDE.md", "AGENTS.md", ".pi/APPEND_SYSTEM.md". None when
no native file-based convention is confirmed to exist (currently
only kimi) — build_config_files skips writing the instructions
file entirely in that case rather than writing inert content nobody
reads. Set only where independently verified against the provider’s
own docs, not guessed — same discipline as base_url_env_var above.
See docs/specs/SPEC_PROVIDER_AWARE_STARTUP_INSTRUCTIONS_2026_08_24.md §2.
native_instruction_sources: &'static [&'static str]Every path (relative to the agent’s working directory) this provider
reads as project instructions — which is not the same question as
startup_instructions_filename above, and is usually a superset of it.
That field names the one file AgentMux writes: the canonical target
it picked per provider. This one names what the provider will pick up
on its own, whether AgentMux put it there or the repository did.
Copilot is the clearest case — it reads
.github/copilot-instructions.md, CLAUDE.md and GEMINI.md besides
the AGENTS.md chosen as the write target — and pi reads
.pi/SYSTEM.md as well as the .pi/APPEND_SYSTEM.md written to.
Phase 3 of SPEC_INSTRUCTION_AND_MEMORY_PORTABILITY_2026_09_09.md
resolves this set to answer “what will this agent actually read”, which
the write target alone cannot (Codex, PR #3144). Nothing writes these
paths — tracking is read-only by design, and the ownership protection
in SPEC_CLAUDE_MD_OWNERSHIP_PROTECTION_2026_08_22.md still governs
the one file AgentMux does write.
Same evidence rule as the field above: listed only where verified against the provider’s own docs, never guessed. Where the only confirmed source is the write target, that is the whole list — an under-complete list means Phase 3 shows the operator less than the truth, which is recoverable; a guessed one means it shows them something false, which is not.
native_instruction_dirs: &'static [InstructionDirScan]Directories a provider scans for instruction files, for the providers whose convention is a pattern rather than a fixed path.
Copilot’s .github/instructions/**/*.instructions.md is the reason
this exists: those are path-scoped instructions that genuinely reach
the agent, so a resolver reading only native_instruction_sources
above would produce an incomplete answer for any repository using them
(Codex, PR #3154), verified in
docs/archive/research-cli-context-files-2026-04-23-copilot-verification.md
claim 3.
Structured rather than a glob string, because there is no glob engine in the tree and one dependency for one pattern shape is a poor trade. It also forces the two things a glob leaves implicit — whether to descend, and what actually qualifies — to be stated.
Same evidence rule as the two fields above.
Implementations§
Source§impl ProviderConfig
impl ProviderConfig
Sourcepub fn controller_type_str(&self) -> &'static str
pub fn controller_type_str(&self) -> &'static str
Return the controller type as the string used in block metadata.
Sourcepub fn resume_strategy_str(&self) -> &'static str
pub fn resume_strategy_str(&self) -> &'static str
Return the provider-specific continuation argv strategy stored in pane
metadata. Codex uses an exec resume subcommand; existing providers
append their configured flag.
Sourcepub fn companion_npm_packages(&self) -> &'static [(&'static str, &'static str)]
pub fn companion_npm_packages(&self) -> &'static [(&'static str, &'static str)]
Packages installed next to npm_package, in the same npm install and
the same pinned dir: (name, version). Pi’s adapter (pi-acp) runs
the pi CLI, which is its own package (@earendil-works/...; the old
@mariozechner/... name stops at 0.73.1).
Sourcepub fn npm_install_specs(&self, pin: &str) -> Vec<String>
pub fn npm_install_specs(&self, pin: &str) -> Vec<String>
Every name@version an install of this provider passes to npm: the
pinned package (at pin, the effective pin) and its companions.
Sourcepub fn prompt_arg_flag(&self) -> Option<&'static str>
pub fn prompt_arg_flag(&self) -> Option<&'static str>
The flag that passes the prompt as an argument, for a CLI that doesn’t
read it from stdin: agy ignores stdin and needs -p <prompt>
(SPEC_ANTIGRAVITY_HARNESS_REAL_CLI_2026_10_06.md). None, the prompt
goes on stdin, for every other provider. Stored in pane meta as
agent:prompt_arg_flag; the frontend’s promptArgFlag mirrors it.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ProviderConfig
impl RefUnwindSafe for ProviderConfig
impl Send for ProviderConfig
impl Sync for ProviderConfig
impl Unpin for ProviderConfig
impl UnsafeUnpin for ProviderConfig
impl UnwindSafe for ProviderConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more