From cde1117966b0318e1d14199712c1eb325b36a47b Mon Sep 17 00:00:00 2001 From: My_lsz <23611557+Mylszd@users.noreply.github.com> Date: Tue, 3 Mar 2026 23:31:57 +0800 Subject: [PATCH] docs(loop-detection): fix config keys to match schema --- docs/tools/loop-detection.md | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/docs/tools/loop-detection.md b/docs/tools/loop-detection.md index f41eeb0851b..97fee0ddbe4 100644 --- a/docs/tools/loop-detection.md +++ b/docs/tools/loop-detection.md @@ -30,14 +30,14 @@ Global defaults: tools: { loopDetection: { enabled: false, - historySize: 20, - detectorCooldownMs: 12000, - repeatThreshold: 3, - criticalThreshold: 6, + historySize: 30, + warningThreshold: 10, + criticalThreshold: 20, + globalCircuitBreakerThreshold: 30, detectors: { - repeatedFailure: true, - knownPollLoop: true, - repeatingNoProgress: true, + genericRepeat: true, + knownPollNoProgress: true, + pingPong: true, }, }, }, @@ -55,8 +55,8 @@ Per-agent override (optional): tools: { loopDetection: { enabled: true, - repeatThreshold: 2, - criticalThreshold: 5, + warningThreshold: 8, + criticalThreshold: 16, }, }, }, @@ -69,18 +69,19 @@ Per-agent override (optional): - `enabled`: Master switch. `false` means no loop detection is performed. - `historySize`: number of recent tool calls kept for analysis. -- `detectorCooldownMs`: time window used by the no-progress detector. -- `repeatThreshold`: minimum repeats before warning/blocking starts. -- `criticalThreshold`: stronger threshold that can trigger stricter handling. -- `detectors.repeatedFailure`: detects repeated failed attempts on the same call path. -- `detectors.knownPollLoop`: detects known polling-like loops. -- `detectors.repeatingNoProgress`: detects high-frequency repeated calls without state change. +- `warningThreshold`: threshold before classifying a pattern as warning-only. +- `criticalThreshold`: threshold for blocking repetitive loop patterns. +- `globalCircuitBreakerThreshold`: global no-progress breaker threshold. +- `detectors.genericRepeat`: detects repeated same-tool + same-params patterns. +- `detectors.knownPollNoProgress`: detects known polling-like patterns with no state change. +- `detectors.pingPong`: detects alternating ping-pong patterns. ## Recommended setup - Start with `enabled: true`, defaults unchanged. - If false positives occur: - - raise `repeatThreshold` and/or `criticalThreshold` + - raise `warningThreshold` and/or `criticalThreshold` + - (optionally) raise `globalCircuitBreakerThreshold` - disable only the detector causing issues - reduce `historySize` for less strict historical context