Problem
The Discord message listener (DiscordMessageListener) processes MESSAGE_CREATE events synchronously. When the AI takes a long time to generate a response, the listener is blocked for the entire duration — preventing any new Discord messages from being picked up until the response completes.
Observed behavior
From gateway logs:
discord/monitor: Slow listener detected — durationMs: 98362 (98s)
discord/monitor: Slow listener detected — durationMs: 83676 (84s)
discord/monitor: Slow listener detected — durationMs: 126388 (126s)
discord/monitor: Slow listener detected — durationMs: 277248 (277s)
discord/monitor: Slow listener detected — durationMs: 637373 (637s!)
The health monitor eventually restarts Discord due to it being 'stuck', but by then messages have been missed or severely delayed.
Expected behavior
Incoming Discord messages should be acknowledged immediately and processed asynchronously. The listener should not block while waiting for an AI response.
Suggested fix
Decouple message intake from response generation. The MESSAGE_CREATE handler should queue/dispatch the work and return immediately, with response delivery happening async.
Environment
- OpenClaw version: 2026.3.2
- Channel: Discord
- OS: macOS 15.7.3 (arm64)
Problem
The Discord message listener (
DiscordMessageListener) processesMESSAGE_CREATEevents synchronously. When the AI takes a long time to generate a response, the listener is blocked for the entire duration — preventing any new Discord messages from being picked up until the response completes.Observed behavior
From gateway logs:
The health monitor eventually restarts Discord due to it being 'stuck', but by then messages have been missed or severely delayed.
Expected behavior
Incoming Discord messages should be acknowledged immediately and processed asynchronously. The listener should not block while waiting for an AI response.
Suggested fix
Decouple message intake from response generation. The
MESSAGE_CREATEhandler should queue/dispatch the work and return immediately, with response delivery happening async.Environment