tool-loop-break 0.1.0

Detect repeated agent tool invocations to break runaway loops. Tracks recent (tool, args_hash) tuples and signals a loop when count exceeds a threshold. Zero deps.
Documentation
  • Coverage
  • 100%
    6 out of 6 items documented1 out of 6 items with examples
  • Size
  • Source code size: 18.98 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 290.2 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 31s Average build duration of successful builds.
  • all releases: 31s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • MukundaKatta/tool-loop-break
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • MukundaKatta

tool-loop-break

crates.io

Sliding-window detector for runaway agent tool loops. Trips when the same (tool, args_fingerprint) appears >= threshold times inside the recent window.

use tool_loop_break::LoopDetector;
let mut d = LoopDetector::new(10, 3);
if d.record("read_file", "abc") {
    // loop! break out of the agent run
}

Zero deps. MIT or Apache-2.0.