pub struct Daemon {
pub max_concurrent_runs: usize,
pub pause_for_interrupts: bool,
}Expand description
How the daemon loop itself behaves, as opposed to what one run does.
Machine-layer material in the same sense Repos::roots is: how many
competitions this machine’s own loop is willing to babysit at once is a
fact about the machine running magi serve, not about any one
repository’s task, so it belongs in <config_dir>/magi/config.toml
rather than a repository’s own magi.toml - though, like Repos::roots,
nothing stops a repository from setting it too, since a scalar field
takes whichever layer has the highest precedence.
Fields§
§max_concurrent_runs: usizeHow many runs magi serve may have actively in flight at once.
One by default - today’s behaviour, one run at a time.
This is a different knob from Graph::max_parallel, and the two
must not be confused: max_parallel bounds how many agent processes
one run starts inside itself (implementers, judges, reviewers -
candidates competing on a single task); this field bounds how many
runs - whole competitions, each with its own max_parallel budget -
the loop drives side by side, possibly across different tasks and
different repositories. Raising max_parallel buys a bigger panel for
one task; raising this buys more tasks worked at once. A config file
that meant one and wrote the other would either starve a competition
of judges or leave the rest of the backlog waiting for no reason.
A run parked waiting on the operator’s land-merge approval - see
crate::land - does not hold one of these slots while it waits: the
whole point of parking there is to let the loop spend the slot on
something runnable instead of sitting on a decision only a human can
make. So even at the default of 1, an approval that comes back does
not queue behind whatever else the loop happens to be running.
pause_for_interrupts: boolLet a task marked crate::queue::Task::interrupt (magi task interrupt) cut ahead of whatever magi serve already has in flight,
instead of waiting for it to finish.
Off by default. When enabled, a run that is in flight and is not
itself the interrupt candidate may be paused at its next safe node
boundary - see crate::graph::Runner::park_here - so the marked
task can run alone; the paused run resumes automatically, through the
same path any other parked run does, the moment the interrupting
task’s own run reaches a terminal status. This is opt-in because it
bends the loop’s own “one run at a time” principle (see this repository’s
magi serve help) for a specific, explicit operator request, and a
repository that never files an interrupt task pays nothing for having
it on - but an operator who does not want any run of theirs preempted,
ever, should leave this false.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Daemon
impl<'de> Deserialize<'de> for Daemon
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 Daemon
impl RefUnwindSafe for Daemon
impl Send for Daemon
impl Sync for Daemon
impl Unpin for Daemon
impl UnsafeUnpin for Daemon
impl UnwindSafe for Daemon
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
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>,
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