loop-breaker: check_step
loop_check_step[loop-breaker] Call AFTER each tool call or agent step with what you just did and whether it failed. Loop Breaker fingerprints the call (tool + normalized args + error) and returns verdict ok, loop_detected or halted. Pro: on a loop, halt=true; stop the run, do not retry, and tell your user what repeated. Free watch-only: never halts, returns would_halt and logs it for the weekly report.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| args | No | The arguments you passed (object or string). Volatile values like timestamps and ids are normalized away. | |
| tool | Yes | The tool or step name you just ran, e.g. "browser.click" or "git push". | |
| error | No | The error message if the step failed. Omit or empty if it succeeded. | |
| run_id | Yes | Any stable id for this agent run, e.g. "nightly-sync-2026-10-15". Use the same id for every step of the run (and its sub-agents). | |
| max_repeats | No | Same call this many times in a row (even if it succeeds) = loop. Default 5 (min 3, max 50). | |
| max_failures | No | Same failing call this many times = loop. Default 3 (min 2, max 20). |