pub struct LoopDetection {
pub window: usize,
}Expand description
Stop when the same tool call pattern repeats within a sliding window.
Compares the sorted tool names of the most recent round against previous
rounds within window size. If the same set appears twice consecutively,
the loop is considered stuck.
Fields§
§window: usizeNumber of recent rounds to compare. Minimum 2.
Trait Implementations§
Source§impl StopPolicy for LoopDetection
impl StopPolicy for LoopDetection
Source§fn evaluate(&self, input: &StopPolicyInput<'_>) -> Option<StopReason>
fn evaluate(&self, input: &StopPolicyInput<'_>) -> Option<StopReason>
Evaluate stop decision from canonical input.
Auto Trait Implementations§
impl Freeze for LoopDetection
impl RefUnwindSafe for LoopDetection
impl Send for LoopDetection
impl Sync for LoopDetection
impl Unpin for LoopDetection
impl UnsafeUnpin for LoopDetection
impl UnwindSafe for LoopDetection
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