Skip to content

Interrupt queue mode sends duplicate response when second message arrives during generation #19426

@kisjovan

Description

@kisjovan

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

  1. Set messages.queue.mode: "interrupt" for WhatsApp
  2. Send a message to the bot
  3. While the bot is generating/sending its response, send a second message immediately after
  4. 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:

  1. Track the last sent response hash per session and skip sending if identical within a short window
  2. Gate outbound delivery on a per-session generation ID, so aborted runs can't send after being superseded
  3. 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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    staleMarked as stale due to inactivity

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions