pub struct AcpConfig {
pub id: &'static str,
pub binary: PathBuf,
pub acp_args: Vec<String>,
pub log_level: Option<String>,
pub connect_timeout: Duration,
pub emit_raw_events: bool,
pub env_passthrough: Vec<String>,
pub model: Option<String>,
}Expand description
ACP backend configuration.
Fields§
§id: &'static strBackend identifier (returned by AgentBackend::id).
binary: PathBufAgent binary; resolved from PATH. Defaults to opencode.
acp_args: Vec<String>Extra arguments passed to the agent binary (e.g. ["acp"]).
log_level: Option<String>Optional --log-level passed to the agent.
connect_timeout: Durationinitialize handshake timeout.
emit_raw_events: boolEmit verbatim ACP session/update notifications as
AgentEvent::AcpRaw.
On by default; the journal does not persist them (see docs/design/acp-raw-events.md).
env_passthrough: Vec<String>Explicit allowlist of environment variable NAMES forwarded to the ACP subprocess. The parent process env is not inherited by default.
Each name is looked up via std::env::var at spawn time; missing
entries are silently skipped. Set to vec![] to forward no
environment at all (subprocess starts with a fully empty env).
AI provider credentials (OPENAI_API_KEY, ANTHROPIC_API_KEY, …)
and the generic MODEL env var are deliberately excluded from the
default — provider/model selection must come from the subprocess’s
own config files (auth.json, config.json) or explicit CLI
arguments, not from the host shell. This is a security and
reproducibility boundary: subprocess behavior does not silently
change because the user happens to have a stray env var set.
Default: AcpConfig::DEFAULT_ENV_PASSTHROUGH — the minimum set
needed for the binary to bootstrap on the current OS (PATH, user
dirs, temp, locale, shell).
model: Option<String>Model to use for LLM calls. Passed via ACP session/set_config_option
with category model. If the agent does not support model selection,
this is silently ignored.
Implementations§
Source§impl AcpConfig
impl AcpConfig
Sourcepub const DEFAULT_ENV_PASSTHROUGH: &'static [&'static str]
pub const DEFAULT_ENV_PASSTHROUGH: &'static [&'static str]
Environment variables forwarded by default. The minimum set needed
for a subprocess to bootstrap on the current OS — no AI provider
keys, no MODEL, no arbitrary shell state. Extend or override via
AcpConfig::env_passthrough.