Skip to main content

Runner

Struct Runner 

Source
pub struct Runner {
    pub command: Vec<String>,
    pub mcp: Option<McpWiring>,
}
Expand description

How to invoke a particular headless agent CLI.

Fields§

§command: Vec<String>

Command and arguments.

{prompt} substitutes the path to the agent’s composed instructions, which the Tower writes into the run’s Hangar before spawning. It is not the instructions themselves.

That distinction is the whole design. A prompt is passed on stdin, never on the command line: Windows caps a command line at 32,767 characters, and real agent prompts go well past it — a sibling project’s review agent composes to roughly 98 KB, three times over, and its ordinary developer agent to 34 KB. Inlining the prompt would work in every test written against a small fixture and fail on the first agent worth running.

So most runners need no placeholder at all. It exists for CLIs that accept a file of instructions as a flag; those that do not get the instructions prepended to stdin.

§mcp: Option<McpWiring>

How this runner is told where Layover’s MCP server is.

Implementations§

Source§

impl Runner

Source

pub const PROMPT_PATH: &'static str = "{prompt}"

The placeholder substituted with the path to the composed instructions.

Source

pub const MODEL: &'static str = "{model}"

The placeholder substituted with the agent’s model.

Every supported CLI spells its model flag differently — --model, -m, a config key — so the spelling stays in the runner command, which is already the one place that knows how to invoke a given CLI. The alternative, a model_flag field, would put half of an invocation in one place and half in another.

Source

pub const MCP: &'static str = "{mcp}"

The placeholder substituted with this runner’s McpWiring::flag and the path to the generated MCP configuration — two arguments, not one.

Optional. A command that does not contain it gets the pair appended at the end, which is what claude and copilot want. It exists for commands that end in a positional argument — codex exec … - reads the prompt from stdin and must stay last — where appending would put a flag after the thing it has to precede.

Source

pub fn takes_prompt_path(&self) -> bool

Returns true when this runner wants the instructions as a file it is handed.

When false, the Tower prepends them to the stdin payload instead.

Source

pub fn takes_model(&self) -> bool

Returns true when this runner can carry an agent’s model.

An agent that declares a model whose runner cannot carry it is a silent no-op: the run happens, on whichever model the CLI defaults to, and nothing says the declaration was ignored. Validation warns about it rather than letting it pass.

Source

pub fn invocation( &self, prompt_path: Option<&str>, model: Option<&str>, ) -> Vec<String>

Builds the command line for one run.

Substitution is textual and deliberately so: a placeholder sits inside an argument like --model={model} as readily as it stands alone, and the operator writes whichever their CLI expects.

An argument that is only a {model} placeholder disappears when no model is set, rather than becoming an empty argument — an empty string in argv is not nothing, and several CLIs treat it as a positional.

Source

pub fn invocation_with_mcp( &self, prompt_path: Option<&str>, model: Option<&str>, mcp_config: Option<&str>, ) -> Vec<String>

The command to run, with every placeholder resolved.

mcp_config is the path to the file McpWiring::format describes. When the command names Self::MCP the flag and path replace it there; otherwise they are appended, which is the right answer for every CLI that does not end in a positional argument.

Trait Implementations§

Source§

impl Clone for Runner

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 Runner

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Runner

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. 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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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

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