工具循环检测(Tool-loop detection)
OpenClaw 可以在工具调用出现重复模式时做保护(默认关闭)。
配置
全局默认:
{
tools: {
loopDetection: {
enabled: false,
historySize: 20,
detectorCooldownMs: 12000,
repeatThreshold: 3,
criticalThreshold: 6,
detectors: {
repeatedFailure: true,
knownPollLoop: true,
repeatingNoProgress: true,
},
},
},
}按 Agent 覆盖:
{
agents: {
list: [
{
id: "safe-runner",
tools: {
loopDetection: { enabled: true, repeatThreshold: 2, criticalThreshold: 5 },
},
},
],
},
}注意事项
- 只在确有需要时开启;过严的阈值可能误伤合法的重复调用。