Skip to content

Telegram: Messages lost when Heartbeat and User message arrive simultaneously (streamMode: partial) #1825

@Imgrund

Description

@Imgrund

Problem

Some messages from the agent are not delivered to Telegram when:

  1. A Heartbeat arrives
  2. A User message is already queued/arrives at the same time
  3. The agent responds to both

The Heartbeat response appears to "overwrite" or cancel the normal reply.

Evidence

Screenshot showing missing message in chat:

  • Agent sent a message about an upcoming workshop (visible in agent logs/session)
  • Message never appeared in Telegram chat
  • User confirmed: "da ist nichts" (nothing there)

Config

{
  "channels": {
    "telegram": {
      "enabled": true,
      "dmPolicy": "pairing",
      "groupPolicy": "open",
      "streamMode": "partial"
    }
  }
}

Hypothesis

The streamMode: "partial" may cause race conditions when multiple responses are being streamed/edited simultaneously. The in-place message editing could fail silently.

Expected Behavior

All agent messages should be reliably delivered, even when Heartbeats and user messages arrive close together.

Environment

  • Clawdbot version: 2026.1.24-2
  • OS: Linux 6.8.0-90-generic (arm64)
  • Node: v22.21.0
  • Telegram: DM with paired user

Workaround

Using the explicit message tool (action=send) appears to work reliably. Only "normal" replies seem affected.

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