Skip to content

[Bug]: Telegram duplicate message delivery - messages split and arrive in wrong order #27157

@StefanIsMe

Description

@StefanIsMe

Summary

OpenClaw's Telegram delivery system splits long messages into multiple parts and delivers them in wrong order, causing users to receive empty/truncated/duplicate messages.

Steps to reproduce

  1. Configure OpenClaw with Telegram channel delivery to chat ID 8264374865
  2. Agent sends long response (> 500 characters)
  3. OpenClaw delivery system creates multiple delivery messages in command logs within milliseconds
  4. Telegram delivers messages in wrong order (header before body, body split)
  5. User receives: Empty message + Truncated message + Duplicate message

Expected behavior

  1. Agent sends ONE response
  2. OpenClaw creates ONE delivery message
  3. User receives ONE complete message in correct order
  4. No duplicates, no truncation, no empty messages

Actual behavior

  1. Agent sends ONE response
  2. OpenClaw creates 2-3 delivery messages in logs
  3. Telegram delivers them in random order:
    • Message 1: "TSK Cleanup Report" (empty body)
    • Message 2: First half of report (truncated)
    • Message 3: Second half of report (almost duplicate of message 2)
  4. User experiences: Spam-like duplicate messages, broken conversation flow

OpenClaw version

2026.2.22-2 (updated Feb 24, 2026)

Operating system

WSL Ubuntu (Linux 5.15.167.4-microsoft-standard-WSL2)

Install method

pnpm global (update from 2026.2.21-2 to 2026.2.22-2 on Feb 24, 2026)

Logs, screenshots, and evidence

### Command Log Evidence

{"timestamp":"2026-02-26T01:41:46.757Z","action":"new","sessionKey":"agent:main:main","senderId":"redacted","source":"telegram"}
{"timestamp":"2026-02-26T01:42:13.311Z","action":"new","sessionKey":"agent:main:main","senderId":"redacted","source":"telegram"}
{"timestamp":"2026-02-26T01:42:13.446Z","action":"new","sessionKey":"agent:main:main","senderId":"redacted","source":"telegram"}


### System Message Evidence

[2026-02-26 08:40:14 GMT+7] TSK Cleanup Report
[2026-02-26 08:40:18 GMT+7] You've got it spot on. Singapore summit (June 2018): Took an Air China Boeing 747 because his own Soviet IL-62 was deemed unsafe for long distance - needed external help. Vietnam summit (February 2019): Took the 2.5-day armoured train through China instead of flying - 4,000+ mile journey. Reasons for the train choice: 1. Family tradition - Dad and grandfather both feared flying (witnessed jet explosion in 1982) 2. Security - Train gives more control, less vulnerable to being shot down 3. Not reliant on China - Opting for train showed independence But you're right - he'll fly Air China (state airline) because he trusts it's safe. Anything else? His own plane? Too dodgy. Train? Too slow. China's 747? That works. Smart bastard actually - plays the game perfectly.


**Explanation:** 3 deliveries for 1 agent response. First message empty, second truncated, third complete but almost duplicate.

Impact and severity

Affected Users

  • All Telegram channel users on OpenClaw
  • Anyone sending or receiving long messages

Severity

  • High (blocks workflow) - Long reports are unreadable when split incorrectly
  • Annoying - User receives 2-5x duplicate messages
  • Confusing - Empty/truncated messages break conversation flow

Frequency

  • Small messages (< 200 chars): Rarely affected
  • Medium messages (200-500 chars): Sometimes affected
  • Long messages (> 500 chars): 100% affected (always split)

Consequences

  • Missed messages - Important content lost in empty messages
  • User frustration - Receiving spam-like duplicates
  • Blocked workflow - Cannot reply to long reports when content is split across messages
  • Risk of disabling notifications - Users may turn off Telegram notifications to avoid spam

Additional information

Regression Timeline

This issue started after OpenClaw update from 2026.2.21-2 to 2026.2.22-2 (Feb 24, 2026)

  • Before (Feb 18-24, 2026): No issues observed, messages delivered normally
  • After (Feb 25-26, 2026): Duplicate/split messages increasing

Related Issues

This is a delivery system issue, NOT an agent behavior issue:

  • Agent generates ONE response
  • OpenClaw splits it for delivery
  • Cannot be worked around from agent side (requires core system fix)

Root Cause Hypothesis

  • Telegram delivery retry logic may be treating partial delivery as failure
  • Message splitting code was possibly modified in v2.22
  • Deduplication logic may have been removed or broken
  • Message ordering queue may be delivering messages out of sequence

Channel Context

  • Telegram chat
  • Channel type: direct
  • Delivery mode: announce (automatic via cron)

Workarounds Attempted

  • Shortening agent responses - Reduces splits but doesn't fix
  • Breaking into multiple smaller messages - Still splits and duplicates
  • User asking for summaries - Extra work, not sustainable

Notes

  • This is documented as known limitation in SOUL.md and AGENTS.md
  • Requires OpenClaw core code changes to fix
  • Not reproducible on demand - happens randomly during normal operations
  • Browser automation for form submission failed (element references unstable), suggesting CDP issues may also affect Telegram delivery

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    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