pub struct RunnerConfig {
pub binary_path: PathBuf,
pub model: Option<String>,
pub timeout: Duration,
pub extra_args: Vec<String>,
pub allowed_env_keys: Vec<String>,
pub env: Vec<(String, String)>,
pub working_directory: Option<PathBuf>,
pub reasoning_effort: Option<ReasoningEffort>,
}Expand description
Configuration for a CLI runner instance
Fields§
§binary_path: PathBufPath to the CLI binary
model: Option<String>Model override (provider-specific format)
timeout: DurationMaximum time to wait for a CLI command to complete: a complete()
call, or the whole of a complete_stream() stream, after which the
child is killed and the call or stream ends with a timeout error
extra_args: Vec<String>Additional CLI arguments appended to every invocation
allowed_env_keys: Vec<String>Environment variable keys passed through to the subprocess
env: Vec<(String, String)>Variables set on the subprocess explicitly, after the sandbox has
cleared its environment and re-injected the allowed keys. This is how
a runner is handed its own credential rather than reading the process
environment: two runners of one type with two tokens are two tiers of
a chain, one per account (see crate::pool).
working_directory: Option<PathBuf>Working directory for the subprocess
reasoning_effort: Option<ReasoningEffort>Reasoning effort forwarded to runners that support it (Copilot CLI / ACP). Runners that do not recognize the flag silently ignore this field.
Implementations§
Source§impl RunnerConfig
impl RunnerConfig
Sourcepub fn new(binary_path: PathBuf) -> Self
pub fn new(binary_path: PathBuf) -> Self
Create a new runner configuration with the given binary path
Sourcepub fn with_env(self, key: impl Into<String>, value: impl Into<String>) -> Self
pub fn with_env(self, key: impl Into<String>, value: impl Into<String>) -> Self
Set a variable on the subprocess explicitly, surviving the sandbox.
The last value wins for a repeated key. A value set here is never read from the host environment, so a pool of runners can each carry a different credential under the same variable name.
Sourcepub fn with_model(self, model: impl Into<String>) -> Self
pub fn with_model(self, model: impl Into<String>) -> Self
Set the model to use
Sourcepub const fn with_timeout(self, timeout: Duration) -> Self
pub const fn with_timeout(self, timeout: Duration) -> Self
Set the command timeout
Sourcepub fn with_extra_args(self, args: Vec<String>) -> Self
pub fn with_extra_args(self, args: Vec<String>) -> Self
Set extra CLI arguments
Sourcepub fn with_allowed_env_keys(self, keys: Vec<String>) -> Self
pub fn with_allowed_env_keys(self, keys: Vec<String>) -> Self
Set the environment variable keys passed through to the subprocess
Sourcepub fn allowing_env_keys(self, keys: &[&str]) -> Self
pub fn allowing_env_keys(self, keys: &[&str]) -> Self
Let the named environment variables through the sandbox as well.
A runner’s own credential (CLAUDE_CODE_OAUTH_TOKEN, OPENAI_API_KEY,
…) is not a leak from the host: without it the child answers “not
logged in” while its --version health check keeps passing. Each CLI
runner calls this from its constructor with the variables its binary
reads, so a caller keeps the default allowlist and still gets a
signed-in child. Keys already present are not repeated.
Sourcepub fn with_working_directory(self, dir: PathBuf) -> Self
pub fn with_working_directory(self, dir: PathBuf) -> Self
Set the working directory for the subprocess
Sourcepub const fn with_reasoning_effort(self, effort: ReasoningEffort) -> Self
pub const fn with_reasoning_effort(self, effort: ReasoningEffort) -> Self
Set the reasoning effort for runners that support it.