Skip to content

Telegram: sendMessageTelegram missing isSilentReply guard (causes flash of streamed text before NO_REPLY suppression) #38603

@susanadmin

Description

@susanadmin

Bug Report

Summary

The sendMessageTelegram adapter is missing the isSilentReplyText guard that exists in sendMessageSlack. While this isn't directly responsible for the flash bug, it's a defensive-coding gap that should be addressed.

The actual flash bug occurs when the agent outputs visible narration/text before the NO_REPLY sentinel in the same response. That pre-sentinel text streams to Telegram as a live preview. OpenClaw's stream handler correctly suppresses NO_REPLY at the end, but by that point the preview has already been delivered to Telegram — which then deletes it, causing a visible flash of text (truncated to "NO" by the time the delete fires).

Steps to Reproduce

  1. Agent uses the message tool to send a Telegram reply
  2. Agent then emits text content followed by NO_REPLY (e.g. reasoning narration before the sentinel)
  3. Telegram receives a streaming preview of the pre-sentinel text
  4. OpenClaw suppresses the final NO_REPLY and deletes the preview
  5. User sees a brief flash of text (typically just "NO") that disappears

Expected Behavior

No visible flash. Either:

  • The stream handler should not forward any deltas to Telegram until enough text has accumulated to rule out a NO_REPLY sentinel, or
  • sendMessageTelegram should include the same isSilentReply guard as sendMessageSlack

Code Reference

Slack (has guard):

// send-C-4qPGvO.js
async function sendMessageSlack(to, message, opts = {}) {
  const trimmedMessage = message?.trim() ?? "";
  if (isSilentReplyText(trimmedMessage) && !opts.mediaUrl && !opts.blocks) {
    logVerbose("slack send: suppressed NO_REPLY token before API call");
    return { messageId: "suppressed", channelId: "" };
  }
  ...
}

Telegram (missing guard):

// send-BfbOwTR-.js
async function sendMessageTelegram(to, text, opts = {}) {
  // ⚠️ No isSilentReplyText check here
  ...
}

Environment

  • OpenClaw version: 2026.3.2
  • Platform: macOS (Darwin 25.3.0, arm64)
  • Channel: Telegram

Suggested Fix

Add the same guard to sendMessageTelegram:

const trimmedText = text?.trim() ?? "";
if (isSilentReplyText(trimmedText) && !opts.mediaUrl && !opts.replyMarkup) {
  logVerbose("telegram send: suppressed NO_REPLY token before API call");
  return { messageId: "suppressed" };
}

And separately, consider buffering stream deltas until enough content has accumulated to confirm the response is not a NO_REPLY sentinel before forwarding to Telegram.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions