惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

量子位
Recent Announcements
Recent Announcements
D
Docker
V
V2EX
阮一峰的网络日志
阮一峰的网络日志
Vercel News
Vercel News
Microsoft Security Blog
Microsoft Security Blog
The GitHub Blog
The GitHub Blog
U
Unit 42
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
月光博客
月光博客
腾讯CDC
B
Blog
博客园_首页
罗磊的独立博客
D
DataBreaches.Net
IT之家
IT之家
酷 壳 – CoolShell
酷 壳 – CoolShell
L
LangChain Blog
aimingoo的专栏
aimingoo的专栏
MongoDB | Blog
MongoDB | Blog
GbyAI
GbyAI
Stack Overflow Blog
Stack Overflow Blog
M
MIT News - Artificial intelligence

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
docs(channels): document bot loop protection · openclaw/o...
steipete · 2026-05-13 · via Recent Commits to openclaw:main

@@ -0,0 +1,131 @@

1+

---

2+

summary: "Bot-to-bot loop protection defaults and channel overrides"

3+

read_when:

4+

- Configuring bot-authored channel messages

5+

- Tuning bot-to-bot loop protection

6+

title: "Bot loop protection"

7+

sidebarTitle: "Bot loop protection"

8+

---

9+10+

# Bot loop protection

11+12+

OpenClaw can accept messages written by other bots on channels that support `allowBots`.

13+

When that path is enabled, pair loop protection prevents two bot identities from

14+

replying to each other indefinitely.

15+16+

The guard is enforced by the core channel-turn kernel. Each supporting channel

17+

maps its own inbound event into generic facts: account or scope, conversation id,

18+

sender bot id, and receiver bot id. Core then tracks the participant pair in both

19+

directions, applies a sliding-window budget, and suppresses the pair during a

20+

cooldown after the budget is exceeded.

21+22+

## Defaults

23+24+

Pair loop protection is active when a channel lets bot-authored messages reach

25+

dispatch. Built-in defaults are:

26+27+

- `maxEventsPerWindow: 20` - a bot pair can exchange 20 events within the window

28+

- `windowSeconds: 60` - sliding window length

29+

- `cooldownSeconds: 60` - suppression time after the pair exceeds the budget

30+31+

The guard does not affect normal human-authored messages, single-bot deployments,

32+

self-message filtering, or one-shot bot replies that stay under the budget.

33+34+

## Configure shared defaults

35+36+

Set `channels.defaults.botLoopProtection` once to give every supporting channel

37+

the same baseline. Channel and account overrides can still tune individual

38+

surfaces.

39+40+

```json5

41+

{

42+

channels: {

43+

defaults: {

44+

botLoopProtection: {

45+

maxEventsPerWindow: 20,

46+

windowSeconds: 60,

47+

cooldownSeconds: 60,

48+

},

49+

},

50+

},

51+

}

52+

```

53+54+

Set `enabled: false` only when your channel policy intentionally allows

55+

bot-to-bot conversations without automatic suppression.

56+57+

## Override per channel or account

58+59+

Supporting channels layer their own config over the shared default. Precedence is:

60+61+

- `channels.<channel>.<room-or-space>.botLoopProtection`, when the channel supports per-conversation overrides

62+

- `channels.<channel>.accounts.<account>.botLoopProtection`, when the channel supports accounts

63+

- `channels.<channel>.botLoopProtection`, when the channel supports top-level defaults

64+

- `channels.defaults.botLoopProtection`

65+

- built-in defaults

66+67+

```json5

68+

{

69+

channels: {

70+

defaults: {

71+

botLoopProtection: {

72+

maxEventsPerWindow: 20,

73+

},

74+

},

75+

discord: {

76+

botLoopProtection: {

77+

maxEventsPerWindow: 8,

78+

},

79+

accounts: {

80+

molty: {

81+

allowBots: "mentions",

82+

botLoopProtection: {

83+

maxEventsPerWindow: 5,

84+

cooldownSeconds: 90,

85+

},

86+

},

87+

},

88+

},

89+

slack: {

90+

allowBots: "mentions",

91+

botLoopProtection: {

92+

maxEventsPerWindow: 8,

93+

},

94+

},

95+

matrix: {

96+

allowBots: "mentions",

97+

groups: {

98+

"!roomid:example.org": {

99+

botLoopProtection: {

100+

maxEventsPerWindow: 5,

101+

},

102+

},

103+

},

104+

},

105+

googlechat: {

106+

allowBots: true,

107+

groups: {

108+

"spaces/AAAA": {

109+

botLoopProtection: {

110+

maxEventsPerWindow: 5,

111+

},

112+

},

113+

},

114+

},

115+

},

116+

}

117+

```

118+119+

## Channel support

120+121+

- Discord: native `author.bot` facts, keyed by Discord account, channel, and bot pair.

122+

- Slack: native `bot_id` facts for accepted bot-authored messages, keyed by Slack account, channel, and bot pair.

123+

- Matrix: configured Matrix bot accounts, keyed by Matrix account, room, and configured bot pair.

124+

- Google Chat: native `sender.type=BOT` facts for accepted bot-authored messages, keyed by account, space, and bot pair.

125+126+

Channels that do not expose a reliable inbound bot identity keep using their

127+

normal self-message and access-policy filters. They should not opt into this

128+

guard until they can identify both participants in the bot pair.

129+130+

See [SDK runtime](/plugins/sdk-runtime#reusable-runtime-utilities) for plugin

131+

implementation details.