Skip to content

Gateway does not strip trailing text after NO_REPLY — causes phantom messages #28874

Closed as not planned

Description

@ZenGardenDubai

Bug

When the agent model outputs NO_REPLY followed by additional text (e.g. NO_REPLY\n\nsome command), the gateway does not suppress the message. The trailing text leaks through and gets sent as a real message to the conversation partner.

Steps to Reproduce

  1. Agent receives an inbound WhatsApp message in a session
  2. Agent model responds with: NO_REPLY\n\nWhat's my favorite color?
  3. Gateway sends "What's my favorite color?" as a real outbound message

Expected

Gateway treats NO_REPLY at the start of a message as a full suppression signal and discards the entire message, including any trailing text.

Actual

Gateway only suppresses when NO_REPLY is the exact and entire message content. Any trailing text after NO_REPLY gets delivered as a real message.

Impact — Critical

In our testing, the leaked text included:

  • Destructive commands: clear everything (sent 3+ times to a WhatsApp AI assistant, risking data deletion)
  • Probing queries: What's my favorite restaurant?, What's my name?
  • Action commands: Delete Test User from contacts, Show all my expenses

This creates a self-amplifying feedback loop:

  1. Agent receives inbound message → outputs malformed NO_REPLY with trailing text
  2. Trailing text gets sent as real message → recipient responds
  3. Response arrives as new inbound → agent outputs another malformed NO_REPLY with more trailing text
  4. Loop continues indefinitely

Context

This was discovered during automated testing where an OpenClaw agent (Claude Opus) was sending test messages to another WhatsApp bot. The agent correctly decided not to reply to the bot's responses but kept appending "thoughts" after NO_REPLY. Those thoughts became real messages.

Suggested Fix

  1. Gateway-level: If a message starts with NO_REPLY (after trimming whitespace), discard the entire message — not just exact matches
  2. Defense in depth: Also strip NO_REPLY prefix and check if remaining text is only whitespace before deciding to send

Environment

  • OpenClaw 2026.2.24
  • Channel: WhatsApp
  • Model: Claude Opus 4.6 (anthropic)

Activity

  1. openclaw-barnacle commented on Mar 28, 2026

    @openclaw-barnacle

    This issue has been automatically marked as stale due to inactivity.
    Please add updates or it will be closed.

  2. added
    stale
    on Mar 28, 2026
  3. openclaw-barnacle commented on Apr 2, 2026

    @openclaw-barnacle

    Closing due to inactivity.
    If this is still an issue, please retry on the latest OpenClaw release and share updated details.
    If you are absolutely sure it still happens on the latest release, open a new issue with fresh repro steps.

  4. locked as resolved and limited conversation to collaborators on Apr 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    stale

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions