pub struct FailureTracker { /* private fields */ }Expand description
Tracks consecutive identical tool failures and produces the model-facing content for each dispatch result.
The loop owns one tracker per drive. Feed it every dispatch outcome in
order: content_for_failure for failures,
record_success for anything else. Because it is
rebuilt from the same recorded sequence on every replay, its output is
identical across replays.
Implementations§
Source§impl FailureTracker
impl FailureTracker
Sourcepub fn record_success(&mut self)
pub fn record_success(&mut self)
Notes a dispatch that did not fail, breaking any repeat streak.
Sourcepub fn content_for_failure(&mut self, tool: &str, full_message: &str) -> String
pub fn content_for_failure(&mut self, tool: &str, full_message: &str) -> String
Notes a failure and returns the content the model should see: the compacted message the first time, a repeat summary from the second consecutive identical failure onward.
Trait Implementations§
Source§impl Debug for FailureTracker
impl Debug for FailureTracker
Source§impl Default for FailureTracker
impl Default for FailureTracker
Source§fn default() -> FailureTracker
fn default() -> FailureTracker
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for FailureTracker
impl RefUnwindSafe for FailureTracker
impl Send for FailureTracker
impl Sync for FailureTracker
impl Unpin for FailureTracker
impl UnsafeUnpin for FailureTracker
impl UnwindSafe for FailureTracker
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