Skip to main content

ProviderConfig

Struct ProviderConfig 

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

Canonical provider identifier (e.g. "claude").

§cli_command: &'static str

Executable name on PATH (e.g. "claude").

§controller_type: ControllerType

Whether 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 str

JSON 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 str

Output format produced by the CLI in styled / streaming mode.

§auth_config_dir_env_var: &'static str

Environment variable that redirects the provider’s config / auth directory, e.g. "CLAUDE_CONFIG_DIR".

§auth_dir_name: &'static str

Sub-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 str

npm package name used for local installation, e.g. "@anthropic-ai/claude-code".

§pinned_version: &'static str

Version 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

Source

pub fn controller_type_str(&self) -> &'static str

Return the controller type as the string used in block metadata.

Source

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.

Source

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).

Source

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.

Source

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§

Source§

impl Debug for ProviderConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert 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>

Convert 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)

Convert &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)

Convert &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
where T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync> ⓘ

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

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

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more