#[non_exhaustive]pub enum StopReason {
Unknown,
Stop,
MaxTokens,
ToolUse,
ContentFilter,
LoopDetected,
BudgetExceeded,
PolicyBlocked,
IdentityRejected,
SessionClosed,
Other,
}Expand description
Why an agent execution step (or session) stopped.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Unknown
Unknown / not reported.
Stop
Natural completion (provider stop).
MaxTokens
Provider truncated at max tokens.
ToolUse
Stopped to invoke a tool.
ContentFilter
Provider content filter.
LoopDetected
AgentVisor AI loop breaker tripped (Module A).
BudgetExceeded
Action/token budget exhausted (Module B).
PolicyBlocked
Policy engine blocked the action (Module B).
IdentityRejected
NHI identity validation rejected the caller (Module D).
SessionClosed
Session explicitly closed.
Other
Other (see stop_reason free text).
Round-29 F7: #[serde(other)] makes this the deserialize
fallback for any unrecognised variant. Heterogeneous
cluster upgrades (harness-N publishing a new stop reason
variant, harness-N-1 reading it back from the bridge
during recovery) would otherwise fail the whole event
parse — dropping evidence and breaking chain
reconstruction on stragglers. Forward-compat: a peer
emitter that adds "FutureVariant" deserializes to
Other; re-serialization emits "Other" (lossy on the
specific variant name, but the free-text stop_reason
field is the intended carrier for that detail anyway).
Implementations§
Source§impl StopReason
impl StopReason
Trait Implementations§
Source§impl Clone for StopReason
impl Clone for StopReason
Source§fn clone(&self) -> StopReason
fn clone(&self) -> StopReason
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 StopReason
impl Debug for StopReason
Source§impl<'de> Deserialize<'de> for StopReason
impl<'de> Deserialize<'de> for StopReason
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>,
Source§impl PartialEq for StopReason
impl PartialEq for StopReason
Source§fn eq(&self, other: &StopReason) -> bool
fn eq(&self, other: &StopReason) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for StopReason
impl Serialize for StopReason
impl Copy for StopReason
impl Eq for StopReason
impl StructuralPartialEq for StopReason
Auto Trait Implementations§
impl Freeze for StopReason
impl RefUnwindSafe for StopReason
impl Send for StopReason
impl Sync for StopReason
impl Unpin for StopReason
impl UnsafeUnpin for StopReason
impl UnwindSafe for StopReason
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.