Skip to main content

RunnerConfig

Struct RunnerConfig 

Source
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: PathBuf

Path to the CLI binary

§model: Option<String>

Model override (provider-specific format)

§timeout: Duration

Maximum 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

Source

pub fn new(binary_path: PathBuf) -> Self

Create a new runner configuration with the given binary path

Source

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.

Source

pub fn with_model(self, model: impl Into<String>) -> Self

Set the model to use

Source

pub const fn with_timeout(self, timeout: Duration) -> Self

Set the command timeout

Source

pub fn with_extra_args(self, args: Vec<String>) -> Self

Set extra CLI arguments

Source

pub fn with_allowed_env_keys(self, keys: Vec<String>) -> Self

Set the environment variable keys passed through to the subprocess

Source

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.

Source

pub fn with_working_directory(self, dir: PathBuf) -> Self

Set the working directory for the subprocess

Source

pub const fn with_reasoning_effort(self, effort: ReasoningEffort) -> Self

Set the reasoning effort for runners that support it.

Trait Implementations§

Source§

impl Clone for RunnerConfig

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RunnerConfig

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

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FutureExt for T

Source§

fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
Source§

fn with_current_context(self) -> WithContext<Self> ⓘ

Attaches the current Context to this type, returning a WithContext wrapper. Read more
Source§

impl<T> Instrument for T

Source§

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

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

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> IntoMaybeUndefined<T> for T

Source§

fn into_maybe_undefined(self) -> MaybeUndefined<T>

Converts this value into a three-state builder argument.
Source§

impl<T> IntoOption<T> for T

Source§

fn into_option(self) -> Option<T>

Converts this value into an optional builder argument.
Source§

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

Source§

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

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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

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

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

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

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

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