pub enum TerminationReason {
CompletionPromise,
MaxIterations,
MaxRuntime,
MaxCost,
ConsecutiveFailures,
LoopThrashing,
ValidationFailure,
Stopped,
Interrupted,
}Expand description
Reason the event loop terminated.
Variants§
CompletionPromise
Completion promise was detected in output.
MaxIterations
Maximum iterations reached.
MaxRuntime
Maximum runtime exceeded.
MaxCost
Maximum cost exceeded.
ConsecutiveFailures
Too many consecutive failures.
LoopThrashing
Loop thrashing detected (repeated blocked events).
ValidationFailure
Too many consecutive malformed JSONL lines in events file.
Stopped
Manually stopped.
Interrupted
Interrupted by signal (SIGINT/SIGTERM).
Implementations§
Source§impl TerminationReason
impl TerminationReason
Sourcepub fn exit_code(&self) -> i32
pub fn exit_code(&self) -> i32
Returns the exit code for this termination reason per spec.
Per spec “Loop Termination” section:
- 0: Completion promise detected (success)
- 1: Consecutive failures or unrecoverable error (failure)
- 2: Max iterations, max runtime, or max cost exceeded (limit)
- 130: User interrupt (SIGINT = 128 + 2)
Trait Implementations§
Source§impl Clone for TerminationReason
impl Clone for TerminationReason
Source§fn clone(&self) -> TerminationReason
fn clone(&self) -> TerminationReason
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TerminationReason
impl Debug for TerminationReason
Source§impl PartialEq for TerminationReason
impl PartialEq for TerminationReason
impl Eq for TerminationReason
impl StructuralPartialEq for TerminationReason
Auto Trait Implementations§
impl Freeze for TerminationReason
impl RefUnwindSafe for TerminationReason
impl Send for TerminationReason
impl Sync for TerminationReason
impl Unpin for TerminationReason
impl UnsafeUnpin for TerminationReason
impl UnwindSafe for TerminationReason
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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
Compare self to
key and return true if they are equal.