-
-
Notifications
You must be signed in to change notification settings - Fork 52.6k
Description
Bug Description
The Discord "typing" indicator gets permanently stuck when an agent turn takes longer than 30 seconds to complete. The only way to clear it is to restart the gateway.
Root Cause (from logs)
The DiscordMessageListener has a 30-second timeout on MESSAGE_CREATE events. When a long-running agent turn (heavy tool use, chained exec commands, spawned background agents, etc.) exceeds this timeout, the listener is killed before the turn completes. The typing indicator is never cleared because the "done typing" signal is never sent.
Relevant log entries:
[EventQueue] Listener DiscordMessageListener timed out after 30000ms for event MESSAGE_CREATE
[discord/monitor] Slow listener detected — durationMs: 32102 (32.1 seconds)
[discord/monitor] Slow listener detected — durationMs: 56555 (56.6 seconds)
Steps to Reproduce
- Send a message via Discord that triggers a long agent turn (e.g. multi-step tool use: exec → build → push, or spawning a background coding agent)
- Agent turn takes >30 seconds
- Observer the Discord channel — typing indicator remains active indefinitely after the response is delivered
- Gateway restart clears the stuck indicator
Expected Behavior
Typing indicator should be cleared regardless of how long the agent turn takes. The "done typing" cleanup should not be tied to the MESSAGE_CREATE listener timeout — it should fire on turn completion (or listener timeout/error).
Environment
- Channel: Discord
- Gateway: OpenClaw (latest)
- OS: macOS Darwin 23.6.0 (x64)
- Node: v22.22.0
- Reproducibility: Consistent — occurs on any turn exceeding ~30s