openclaw - 💡(How to fix) Fix [Bug]: Agent text output delivered to Telegram even when agent uses only Bot API + NO_REPLY [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#56899Fetched 2026-04-08 01:46:21
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0
Participants

In a multi-agent Telegram setup, our orchestrator agent delivers all user-facing messages exclusively via Telegram Bot API (curl) and ends every turn with NO_REPLY. Despite this, any text the model produces before, between, or after tool calls is delivered to the user as separate Telegram messages.

This results in duplicate/garbage messages — the user sees both the curl-delivered formatted message AND raw intermediate text from the model.

Root Cause

In a multi-agent Telegram setup, our orchestrator agent delivers all user-facing messages exclusively via Telegram Bot API (curl) and ends every turn with NO_REPLY. Despite this, any text the model produces before, between, or after tool calls is delivered to the user as separate Telegram messages.

This results in duplicate/garbage messages — the user sees both the curl-delivered formatted message AND raw intermediate text from the model.

Code Example

streaming: "off"
thinkingDefault: "medium"
blockStreamingDefault: not set
RAW_BUFFERClick to expand / collapse

Summary

In a multi-agent Telegram setup, our orchestrator agent delivers all user-facing messages exclusively via Telegram Bot API (curl) and ends every turn with NO_REPLY. Despite this, any text the model produces before, between, or after tool calls is delivered to the user as separate Telegram messages.

This results in duplicate/garbage messages — the user sees both the curl-delivered formatted message AND raw intermediate text from the model.

Steps to reproduce

  1. Configure an agent that uses curl to Bot API for all replies
  2. Agent instructions say: always end with NO_REPLY
  3. Agent performs multi-step tool use (exec, memory_search, etc.)
  4. Model produces text between tool calls (e.g. "Let me check...")
  5. Each text segment arrives as a separate Telegram message
  6. Final text (if any before NO_REPLY) also arrives as a message

Expected behavior

When an agent ends its turn with NO_REPLY, no text should be delivered to the channel. The agent manages its own delivery.

Actual behavior

Every text block (intermediate and final) is delivered as a visible Telegram message regardless of NO_REPLY at the end of the turn.

Configuration

streaming: "off"
thinkingDefault: "medium"
blockStreamingDefault: not set

Environment

  • OpenClaw 2026.3.28
  • Telegram (long-polling, DM)

Related

  • #13944
  • #15473
  • #25374
  • #50985
  • #50989

extent analysis

Fix Plan

To resolve the issue of duplicate/garbage messages being delivered to the user, we need to modify the agent to suppress any text output before ending its turn with NO_REPLY.

Here are the concrete steps:

  • Modify the agent code to buffer any text output during its turn.
  • Only deliver the final formatted message via the Telegram Bot API (curl).
  • Ensure that the agent ends its turn with NO_REPLY after delivering the final message.

Example code snippet (in Python):

# Initialize an empty buffer for text output
text_buffer = []

# During the agent's turn, append any text output to the buffer
text_buffer.append("Let me check...")

# Perform tool calls and other operations

# Deliver the final formatted message via Telegram Bot API (curl)
final_message = "Final answer: 42"
requests.post(
    f"https://api.telegram.org/bot{BOT_TOKEN}/sendMessage",
    json={"chat_id": chat_id, "text": final_message}
)

# End the turn with NO_REPLY
print("NO_REPLY")

In this example, any text output during the agent's turn is appended to the text_buffer list, but not delivered to the user. Only the final formatted message is delivered via the Telegram Bot API (curl), and the turn is ended with NO_REPLY.

Verification

To verify that the fix worked, test the agent in a multi-step scenario and check that:

  • Only the final formatted message is delivered to the user.
  • No intermediate text output is visible to the user.
  • The agent ends its turn with NO_REPLY as expected.

Extra Tips

  • Ensure that the streaming configuration is set to "off" to prevent any intermediate text output from being delivered to the user.
  • Review the related issues (#13944, #15473, #25374, #50985, #50989) to ensure that this fix does not introduce any regressions.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

When an agent ends its turn with NO_REPLY, no text should be delivered to the channel. The agent manages its own delivery.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING