mirror of
https://github.com/Heretek-AI/openclaw.git
synced 2026-07-22 23:25:21 -04:00
a9ae1a6778
Matrix Protocol: - docker-compose.matrix.yml: Dendrite homeserver + PostgreSQL + Nginx TLS - src/channels/plugins/matrix-channel.ts: OpenClaw plugin implementation - docs/matrix-triad-setup.md: Setup guide with auth scheme (@tm1-4:triad.local) MCP Server Integration: - docs/mcp-triad-integration.md: SearXNG, Playwright, GitHub MCP configs - docs/mcp-curiosity-mapping.md: Gap-to-capability mapping Node Sync Architecture: - src/services/node-sync-service.ts: WebSocket peer sync + presence detection - src/services/node-sync-service.test.ts: Unit tests - docs/node-sync-architecture.md: Architecture docs Triad Resilience: - scripts/triad-corruption-check.mjs: SQLite + log + config + git integrity - docs/triad-resilience.md: Recovery procedures - .secure/deployment-logs/README.md: Schema v2 - skills/triad-heartbeat/SKILL.md: Corruption check integration NPM Publish Workflow: - scripts/npm-publish.mjs: version, changelog, validate, publish, rollback - .github/workflows/npm-publish.yml: GitHub Actions with provenance - docs/npm-publish-guide.md: Complete documentation All deliverables tested in Docker before production.
2.9 KiB
Executable File
2.9 KiB
Executable File
title, summary, read_when
| title | summary | read_when | |||
|---|---|---|---|---|---|
| Tool-loop detection | How to enable and tune guardrails that detect repetitive tool-call loops |
|
Tool-loop detection
OpenClaw can keep agents from getting stuck in repeated tool-call patterns. The guard is disabled by default.
Enable it only where needed, because it can block legitimate repeated calls with strict settings.
Why this exists
- Detect repetitive sequences that do not make progress.
- Detect high-frequency no-result loops (same tool, same inputs, repeated errors).
- Detect specific repeated-call patterns for known polling tools.
Configuration block
Global defaults:
{
tools: {
loopDetection: {
enabled: false,
historySize: 30,
warningThreshold: 10,
criticalThreshold: 20,
globalCircuitBreakerThreshold: 30,
detectors: {
genericRepeat: true,
knownPollNoProgress: true,
pingPong: true,
},
},
},
}
Per-agent override (optional):
{
agents: {
list: [
{
id: "safe-runner",
tools: {
loopDetection: {
enabled: true,
warningThreshold: 8,
criticalThreshold: 16,
},
},
},
],
},
}
Field behavior
enabled: Master switch.falsemeans no loop detection is performed.historySize: number of recent tool calls kept for analysis.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. - Keep thresholds ordered as
warningThreshold < criticalThreshold < globalCircuitBreakerThreshold. - If false positives occur:
- raise
warningThresholdand/orcriticalThreshold - (optionally) raise
globalCircuitBreakerThreshold - disable only the detector causing issues
- reduce
historySizefor less strict historical context
- raise
Logs and expected behavior
When a loop is detected, OpenClaw reports a loop event and blocks or dampens the next tool-cycle depending on severity. This protects users from runaway token spend and lockups while preserving normal tool access.
- Prefer warning and temporary suppression first.
- Escalate only when repeated evidence accumulates.
Notes
tools.loopDetectionis merged with agent-level overrides.- Per-agent config fully overrides or extends global values.
- If no config exists, guardrails stay off.