You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/multi-agent.md
+74Lines changed: 74 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -51,3 +51,77 @@ See individual agent docs for authentication steps:
51
51
-[Claude Code](claude-code.md)
52
52
-[Codex](codex.md)
53
53
-[Gemini](gemini.md)
54
+
55
+
## Bot-to-Bot Communication
56
+
57
+
By default, each agent ignores messages from other bots. To enable multi-agent collaboration in the same channel (e.g. a code review bot handing off to a deploy bot), configure `allow_bot_messages` in each agent's `config.toml`:
58
+
59
+
```toml
60
+
[discord]
61
+
allow_bot_messages = "mentions"# recommended
62
+
```
63
+
64
+
### Modes
65
+
66
+
| Value | Behavior | Loop risk |
67
+
|---|---|---|
68
+
|`"off"` (default) | Ignore all bot messages | None |
69
+
|`"mentions"`| Only respond to bot messages that @mention this bot | Very low — bots must explicitly @mention each other |
70
+
|`"all"`| Respond to all bot messages | Mitigated by turn cap (10 consecutive bot messages) |
71
+
72
+
### Which mode should I use?
73
+
74
+
**`"mentions"` is recommended for most setups.** It enables collaboration while acting as a natural loop breaker — Bot A only processes Bot B's message if Bot B explicitly @mentions Bot A. Two bots won't accidentally ping-pong.
75
+
76
+
Use `"all"` only when bots need to react to each other's messages without explicit mentions (e.g. monitoring bots). A hard cap of 10 consecutive bot-to-bot turns prevents infinite loops.
- The bot's own messages are **always** ignored, regardless of setting
112
+
-`"mentions"` mode is a natural loop breaker — no rate limiter needed
113
+
-`"all"` mode has a hard cap of 10 consecutive bot-to-bot turns per channel
114
+
- Channel and user allowlists still apply to bot messages
115
+
-`trusted_bot_ids` further restricts which bots are allowed through
116
+
117
+
### Restricting to specific bots
118
+
119
+
If you only want to accept messages from specific bots (e.g. your own deploy bot), add their Discord user IDs:
120
+
121
+
```toml
122
+
[discord]
123
+
allow_bot_messages = "mentions"
124
+
trusted_bot_ids = ["123456789012345678"] # only this bot's messages pass through
125
+
```
126
+
127
+
When `trusted_bot_ids` is empty (default), any bot can pass through (subject to the mode check). When set, only listed bots are accepted — all others are silently ignored.
0 commit comments