-
-
Notifications
You must be signed in to change notification settings - Fork 54.5k
Description
Bug
When messages.queue.mode is set to interrupt, sending two messages in quick succession (e.g., splitting a thought into two messages) causes the bot to send the same response twice.
Steps to Reproduce
- Set
messages.queue.mode: "interrupt"for WhatsApp - Send a message to the bot
- While the bot is generating/sending its response, send a second message immediately after
- The bot sends its response, then sends the same response again
Expected Behavior
The second message should interrupt the first run and generate a single response that incorporates both messages.
Actual Behavior
The response from the first run is sent (it completes before the abort takes effect), then a second run starts with effectively the same context and sends a near-identical response.
Root Cause (from source analysis)
In src/auto-reply/reply/get-reply-run.ts:362, interrupt mode calls clearCommandLane and abortEmbeddedPiRun, but if the first run has already finished generating and the response is in the outbound delivery pipeline, the abort is too late. The second run then generates a duplicate.
There's no outbound dedup mechanism to catch this case.
Suggested Fix
Either:
- Track the last sent response hash per session and skip sending if identical within a short window
- Gate outbound delivery on a per-session generation ID, so aborted runs can't send after being superseded
- Add a brief outbound dedup window for identical messages to the same chat
Environment
- OpenClaw version: 2026.2.14
- Channel: WhatsApp
- Queue mode: interrupt
- OS: Linux (Arch)