Skip to content

Telegram streaming leaks partial NO_REPLY as visible message #33544

Closed

Description

@himbot2099-lang

Description

When using streaming: partial (the new default in 2026.3.2), responding with NO_REPLY after a reaction-only action causes the first token "NO" to be streamed to the Telegram chat as a visible message before the system recognizes and swallows the full NO_REPLY directive. The message is briefly pinned and then removed after ~10 seconds.

Steps to Reproduce

  1. Set channels.telegram.streaming: partial (or leave as default in 2026.3.2)
  2. Have the agent call message(action=react) to react to a user message
  3. Agent responds with NO_REPLY as its reply
  4. Observe: "NO" appears as a visible message in the Telegram DM, briefly pinned

Expected Behavior

NO_REPLY should be recognized and filtered before any tokens are streamed to Telegram. The user should see only the reaction, no text message.

Workaround

Instead of NO_REPLY, send a minimal actual text reply (e.g. a single emoji or brief acknowledgment) after reactions. This avoids the streaming leak entirely.

Environment

  • OpenClaw version: 2026.3.2
  • Channel: Telegram (DM)
  • Streaming mode: partial
  • OS: macOS (arm64)

Activity

  1. Dingding-leo commented on Mar 3, 2026

    @Dingding-leo

    This is a race condition in the streaming path. The NO_REPLY directive is being processed too late - after some tokens have already been sent.

    Root cause:

    // Streaming path:
    stream tokens → send to Telegram → check for NO_REPLY
    // Should be:
    check for NO_REPLY → if yes, don't stream at all

    The fix:

    1. Pre-check before streaming:
      In the Telegram send path, check if the response is NO_REPLY before starting to stream:
    if (message === "NO_REPLY") {
      return; anything
    }

    // Don't stream2. Or buffer and check:
    Buffer the initial tokens, check if it's NO_REPLY, then either send or discard.

    1. Check at chunk boundaries:
      Even if streaming starts, check each chunk for NO_REPLY and abort mid-stream.

    Debugging:

    • Add logging at the point where NO_REPLY is detected
    • Check how other channels handle this

    Workaround noted in issue is correct:
    Use a minimal actual text reply (emoji) instead of NO_REPLY after reactions.

    This is a regression in 2026.3.2 where the new default streaming: partial introduced this race condition.

  2. Sid-Qin commented on Mar 4, 2026

    @Sid-Qin
  3. obviyus commented on Mar 4, 2026

    @obviyus
    Collaborator

    Thanks for the detailed report.

    Confirmed root cause is slightly different from a Telegram-only send-path race:

    • In v2026.3.2, shared silent-prefix filtering (isSilentReplyPrefixText) only treated uppercase fragments with _ as suppressible.
    • That let the first partial token NO from streamed NO_REPLY pass before later chunks (NO_, NO_RE, NO_REPLY) were swallowed.
    • Telegram exposed it most clearly because channels.telegram.streaming default changed to partial in 2026.3.2.

    Fix is already in shared auto-reply streaming path (not Telegram-only), so all channels benefit:

    • Prefix suppression now explicitly handles bare NO for NO_REPLY fragments.
    • Suppression still runs before channel partial callbacks.
    • Regression coverage includes NO -> NO_ -> NO_RE -> NO_REPLY.

    This is fixed on main and included in the 2026.3.3 line (Telegram/draft preview boundary + silent-token reliability, #33169).

    PR #33663 was closed as redundant.

  4. locked as resolved and limited conversation to collaborators on Mar 6, 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

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions