Summary
Reaction event listeners (DiscordReactionListener, DiscordReactionRemoveListener) are always registered regardless of guild configuration. When all guilds have reactionNotifications: "off", reaction events still hit the event queue, go through guild config resolution and authorization checks, then return early. This triggers Slow listener detected warnings and contributes to event queue congestion.
Environment
- OpenClaw: 2026.3.13 (61d171a)
- OS: Windows 11 (x64)
- Node: v22.22.0
- Discord with 2 guilds, both
reactionNotifications: "off"
- 28 active sessions
Root Cause
In dist/discord-CcCLMjHw.js (line ~139651), reaction listeners are registered unconditionally:
registerDiscordListener(client.listeners, new DiscordReactionListener(reactionListenerOptions));
registerDiscordListener(client.listeners, new DiscordReactionRemoveListener(reactionListenerOptions));
Even though the handler checks reactionMode === "off" and returns early, the listener is still registered on the EventEmitter, processes the event through the queue, resolves guild info, and triggers slow listener detection before bailing.
Impact
Slow listener detected warnings on every reaction event
- Event queue congestion when many reactions happen (e.g., multi-agent Discord servers where bots react to each other)
- Unnecessary processing overhead
Suggested Fix
Skip listener registration when all configured guilds have reactionNotifications: "off":
const allGuildsReactionsOff = guildEntries &&
Object.keys(guildEntries).length > 0 &&
Object.values(guildEntries).every(g => g.reactionNotifications === "off");
if (!allGuildsReactionsOff) {
registerDiscordListener(client.listeners, new DiscordReactionListener(reactionListenerOptions));
registerDiscordListener(client.listeners, new DiscordReactionRemoveListener(reactionListenerOptions));
}
This is the patch I applied locally and it resolved the slow listener warnings immediately.
Workaround
Manually patch the dist file as shown above. Gets overwritten on update.
Summary
Reaction event listeners (DiscordReactionListener, DiscordReactionRemoveListener) are always registered regardless of guild configuration. When all guilds have
reactionNotifications: "off", reaction events still hit the event queue, go through guild config resolution and authorization checks, then return early. This triggersSlow listener detectedwarnings and contributes to event queue congestion.Environment
reactionNotifications: "off"Root Cause
In
dist/discord-CcCLMjHw.js(line ~139651), reaction listeners are registered unconditionally:Even though the handler checks
reactionMode === "off"and returns early, the listener is still registered on the EventEmitter, processes the event through the queue, resolves guild info, and triggers slow listener detection before bailing.Impact
Slow listener detectedwarnings on every reaction eventSuggested Fix
Skip listener registration when all configured guilds have
reactionNotifications: "off":This is the patch I applied locally and it resolved the slow listener warnings immediately.
Workaround
Manually patch the dist file as shown above. Gets overwritten on update.