pub enum WaitReason {
ToolApproval,
UserPrompt,
TaintGate,
InteractionPoint,
FanOutWorkers {
outstanding: usize,
},
Children {
outstanding: usize,
},
NeedsSetup {
blocker: SetupBlocker,
remedy: String,
},
}Expand description
Why an agent’s status is AgentStatus::Waiting.
Lives in leviath-core because it is written to meta.json as well as
reported live over the control socket, and re-exported here so every
existing components::WaitReason path keeps working.
Why a run’s status is RunStatus::WaitingInput.
WaitingInput alone is several unrelated situations wearing one word, and
they call for opposite responses: a fan-out parent whose workers are
churning is healthy and needs nothing, while a run parked on a
tool-approval prompt is stopped dead until a person answers it. Issue #184
is what happens when the two are indistinguishable - an operator reading
waiting across a factory concluded it had stalled and started killing
healthy runs. Issue #431 is the same conflation reaching every client that
reads meta.json.
Derived on demand from markers the engine already sets, by
wait_reason_from; nothing tracks it separately, so it cannot fall out of
sync with the status it explains. It lives here rather than in the runtime
because it is both reported live over the control socket and written to
meta.json, and one vocabulary across those two is the whole point.
Deliberately not new RunStatus variants: the status is matched
exhaustively across the codebase and serialized two ways on the wire, so
splitting it would break every consumer to express something that is not a
new state. The run really is waiting; this says on what.
Variants§
ToolApproval
Blocked on a tool-approval prompt. Needs a person (or --yolo).
UserPrompt
Blocked on a question the agent itself asked (ask_user_*,
present_for_review). Needs a person.
TaintGate
Blocked on a taint-gate clearance prompt. Needs a person.
InteractionPoint
Blocked on a blueprint stage-boundary checkpoint. Needs a person.
FanOutWorkers
Parked while fan-out workers run. Healthy; resolves on its own.
Children
Parked while spawned sub-agents run (requires_children). Healthy;
resolves on its own.
NeedsSetup
Parked because something on the machine has to change before this run can go on: a provider it needs is not configured, a key was rejected, an account is out of credits.
These used to end the run. They are all deterministic and all outside
the run’s control, so ending it threw away everything it had done to
punish a person for a typo in config.toml. The run holds its place
instead, and lev resume picks it up once the machine is fixed.
The distinction that matters is not “is there a fix” but “does the fix let this run continue”: a broken blueprint is equally deterministic and equally fixable, and still cannot be resumed into, because the blueprint was read at spawn.
Fields
blocker: SetupBlockerWhich kind of problem, so a client can offer the right thing to do rather than parse the sentence below.
Implementations§
Source§impl WaitReason
impl WaitReason
Sourcepub fn needs_a_person(&self) -> bool
pub fn needs_a_person(&self) -> bool
Whether clearing this needs a person. false means the run is parked on
other work and will move on by itself.
Trait Implementations§
Source§impl Clone for WaitReason
impl Clone for WaitReason
Source§fn clone(&self) -> WaitReason
fn clone(&self) -> WaitReason
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for WaitReason
impl Debug for WaitReason
Source§impl<'de> Deserialize<'de> for WaitReason
impl<'de> Deserialize<'de> for WaitReason
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<WaitReason, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<WaitReason, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Display for WaitReason
impl Display for WaitReason
impl Eq for WaitReason
Source§impl Hash for WaitReason
impl Hash for WaitReason
Source§impl PartialEq for WaitReason
impl PartialEq for WaitReason
Source§impl Serialize for WaitReason
impl Serialize for WaitReason
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for WaitReason
Auto Trait Implementations§
impl Freeze for WaitReason
impl RefUnwindSafe for WaitReason
impl Send for WaitReason
impl Sync for WaitReason
impl Unpin for WaitReason
impl UnsafeUnpin for WaitReason
impl UnwindSafe for WaitReason
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> ConditionalSend for Twhere
T: Send,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.