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
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# tool-loop-break

[![crates.io](https://img.shields.io/crates/v/tool-loop-break.svg)](https://crates.io/crates/tool-loop-break)

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

```rust
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.