pub enum SessionStatus {
Created,
Running,
Cancelled,
Finished,
Failed,
DeadlineExceeded,
}Expand description
Lifecycle status of a Session.
Why: a small, closed set of states the registry can transition between
and that a client can match on reliably (the wire string is stable —
#[serde(rename_all = "snake_case")] — independent of Rust variant
naming).
What: Created -> Running happens immediately on session.create in
M1 (there is no queue to sit in ahead of real task execution, which
lands with task.* in #2056). Cancelled/Finished/Failed/
DeadlineExceeded are the four terminal states; session.cancel is the
only one #2054 can drive directly (Finished/Failed/DeadlineExceeded
are set by task::executor::run_and_record when the PM’s AgentLoop
resolves). DeadlineExceeded (#2207) is distinct from Failed: it means
the run’s configured wall-clock budget elapsed before the PM reached a
terminal state, NOT that the loop or LLM call errored — a run that hit
this status may have made real, useful progress.
Test: model::tests::session_status_serialises_snake_case.
Variants§
Implementations§
Source§impl SessionStatus
impl SessionStatus
Sourcepub fn as_str(&self) -> &'static str
pub fn as_str(&self) -> &'static str
Return the stable wire string for this status (matches the serde
rename_all = "snake_case" representation).
Why: crate::events::Event::SessionStatusChanged’s status field is
a plain String, not a SessionStatus, so registry code needs the
wire string without round-tripping through serde_json.
What: a &'static str per variant.
Test: model::tests::as_str_matches_serde_rename.
Sourcepub fn is_terminal(&self) -> bool
pub fn is_terminal(&self) -> bool
Returns true when this status is terminal (the session will never
transition again).
Why: session.cancel and any future completion handler need to
reject transitions out of a terminal state (e.g. cancelling an
already-finished session is a no-op error, not a silent overwrite).
What: true for Cancelled/Finished/Failed/DeadlineExceeded;
false otherwise.
Test: model::tests::is_terminal_covers_terminal_states.
Trait Implementations§
Source§impl Clone for SessionStatus
impl Clone for SessionStatus
Source§fn clone(&self) -> SessionStatus
fn clone(&self) -> SessionStatus
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for SessionStatus
Source§impl Debug for SessionStatus
impl Debug for SessionStatus
Source§impl<'de> Deserialize<'de> for SessionStatus
impl<'de> Deserialize<'de> for SessionStatus
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>,
impl Eq for SessionStatus
Source§impl PartialEq for SessionStatus
impl PartialEq for SessionStatus
Source§impl Serialize for SessionStatus
impl Serialize for SessionStatus
impl StructuralPartialEq for SessionStatus
Auto Trait Implementations§
impl Freeze for SessionStatus
impl RefUnwindSafe for SessionStatus
impl Send for SessionStatus
impl Sync for SessionStatus
impl Unpin for SessionStatus
impl UnsafeUnpin for SessionStatus
impl UnwindSafe for SessionStatus
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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