pub struct FleetWorkerConfig {
pub accepts_work: bool,
pub repos: Vec<PathBuf>,
pub max_parallel: u32,
pub local_parallel: u32,
pub dispatches_per_hour: u32,
pub max_subtask_secs: u64,
pub fetch_missing_base: bool,
pub fetch_remote: String,
pub allowed_tools: Option<Vec<String>>,
}Expand description
Whether this instance takes farmed-out coding work, and under what limits.
Persisted at ~/.car/fleet-worker.json (under CAR_HOME when set) rather
than read from the environment, because it is an operator decision that must
survive a restart and be inspectable — an env var would make “does this
machine run my peers’ prompts?” depend on how the daemon happened to be
launched.
Fields§
§accepts_work: boolOff by default. Turning it on lets a trusted peer run a coding CLI
against the checkouts named in repos.
repos: Vec<PathBuf>Repository checkouts this host will serve. A dispatch is matched to one of these by root commit; anything else is declined.
max_parallel: u32Peers’ subtasks run here at once.
local_parallel: u32This host’s own share when it orchestrates a distributed run. Separate
from max_parallel, which bounds what peers may spend here.
dispatches_per_hour: u32Dispatches ONE peer may start here per hour.
max_parallel bounds concurrency, which is not a bound on spend: a peer
that dispatches one subtask, waits, and dispatches the next never
exceeds it and can still drain this machine’s coding-CLI quota. This is
the budget. 0 accepts nothing while keeping the rest of the config.
max_subtask_secs: u64Hard ceiling on a peer-supplied timeout_secs.
The dispatch carries a timeout the sender chose. A machine agreeing to take work is not agreeing to be occupied for as long as the caller likes, so the sender’s value is clamped to this and an omitted one defaults to it.
fetch_missing_base: boolFetch a missing base commit from this checkout’s own remote instead of declining — the posture that makes a machine a runner rather than a person’s laptop.
Off by default, because on a laptop it means a peer’s dispatch can cause
a network fetch in a repository the operator is working in. On a runner
it is the whole point: a machine that continuously tracks origin
always has the base commit, which is what turns an idle pool into a
working one. Adds no trust — the fetch targets the remote this checkout
is already configured with, never anything the dispatch supplied.
fetch_remote: StringRemote a runner fetches from. origin unless an operator says otherwise.
allowed_tools: Option<Vec<String>>Tools a peer’s coding CLI may use here, intersected with whatever the dispatch asks for.
None (the default) adds no restriction beyond the CLI’s own, which is
the honest default: a coding subtask needs to read, edit, and usually
build, so a narrow allowlist mostly turns into every dispatch failing
for reasons the sender cannot see. Set it when this machine should be
stricter than the work requires.
Implementations§
Source§impl FleetWorkerConfig
impl FleetWorkerConfig
Sourcepub fn load() -> Self
pub fn load() -> Self
Read the config, falling back to the declining default.
A malformed file reads as the default rather than as an error: the failure mode of “unparseable config” must be declining work, never accepting it under a half-read set of limits.
pub fn save(&self) -> Result<(), String>
Trait Implementations§
Source§impl Clone for FleetWorkerConfig
impl Clone for FleetWorkerConfig
Source§impl Debug for FleetWorkerConfig
impl Debug for FleetWorkerConfig
Source§impl Default for FleetWorkerConfig
impl Default for FleetWorkerConfig
Source§impl<'de> Deserialize<'de> for FleetWorkerConfig
impl<'de> Deserialize<'de> for FleetWorkerConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for FleetWorkerConfig
impl RefUnwindSafe for FleetWorkerConfig
impl Send for FleetWorkerConfig
impl Sync for FleetWorkerConfig
impl Unpin for FleetWorkerConfig
impl UnsafeUnpin for FleetWorkerConfig
impl UnwindSafe for FleetWorkerConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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