Skip to content

[Bug]: Message Loss on Telegram Network Failure #54708

@Jorem999

Description

@Jorem999

Bug type

Regression (worked before, now fails)

Summary

Component: OpenClaw Gateway - Telegram Channel
Severity: High
Status: Confirmed, reproducible
Date: 2026-03-25
Reporter: Jorge Moncayo (@Jorem999)


Summary

When a network interruption occurs during message generation, the agent loses the entire response. The sendChatAction API call fails, but the generated message is not persisted or retried. The user sees "typing..." for 2 minutes until TTL timeout, but never receives the message.


Environment

  • OpenClaw Version: v2026.3.23-2 (also affects v2026.3.13)
  • OS: Xubuntu Linux (4GB RAM, swap configured)
  • Channel: Telegram
  • Network: Stable local network with occasional brief interruptions
  • Model: ollama/kimi-k2.5:cloud (cloud-based, not local)

Root Cause Analysis

The message generation and delivery are coupled. When sendChatAction fails, the generated message buffer is discarded instead of being queued for retry.

Additional findings:

  • System has adequate resources (4GB RAM, 3GB free, swap available but unused)
  • Not a memory issue
  • Not a model timeout issue (cloud model)
  • Specific to Telegram channel network failures

Suggested Fix

  1. Decouple generation from delivery: Save complete message to local queue before attempting any Telegram API calls
  2. Implement retry logic: Exponential backoff for sendChatAction and sendMessage failures
  3. Persistence: If gateway restarts, check for undelivered messages in queue
  4. User notification: If delivery fails after N retries, send "⚠️ Message delivery failed" to user
  5. Heartbeat check: Verify connectivity before starting long message generation

Workaround for Users

If "typing..." shows for >60 seconds without response, send a "." to reactivate session. The previous message is likely lost and must be resent.


Impact

This bug causes users to lose confidence in the system when responses "disappear" without explanation. In testing, this occurred multiple times and led to temporary abandonment of OpenClaw usage.


Assistant Analysis: OpenClaw Agent (kimi-k2.5:cloud)
Session: 2026-03-24 to 2026-03-25

Steps to reproduce

Steps to Reproduce

  1. Start a conversation with the agent
  2. Send a message that requires a long response (e.g., request analysis of files)
  3. During response generation, cause a brief network interruption (or wait for natural transient failure)
  4. Observe logs: [telegram] sendChatAction failed: Network request failed!
  5. Observe: "typing..." indicator persists for ~2 minutes
  6. Observe: [telegram] typing TTL reached (2m); stopping typing indicator
  7. Result: Message is lost, user never receives response

Expected behavior

Expected Behavior

  • Message should be persisted before attempting to send sendChatAction
  • On network failure, system should queue message and retry delivery
  • User should eventually receive the message once connectivity is restored
  • OR: At minimum, user should be notified that message delivery failed

Actual behavior

Actual Behavior

  • Message is lost completely
  • No retry mechanism
  • No notification to user
  • Agent appears to "hang" then "disappear"
  • Context may be lost if gateway restarts

OpenClaw version

OpenClaw 2026.3.23-2 (7ffe7e4)

Operating system

XUbuntu 24.04.4 LTS

Install method

npm global

Model

ollama/kimi-k2.5:cloud

Provider / routing chain

ollama/kimi-k2.5:cloud via OpenClaw Gateway → Telegram Channel

Additional provider/model setup details

• Gateway: OpenClaw v2026.3.23-2, modo local, bind en 0.0.0.0:18789
• Provider: Ollama en Nonna (192.168.100.50:11434)
• Model: kimi-k2.5:cloud (inferencia en la nube, no local)
• Channel: Telegram (@Jorge_Loco_bot)

Logs, screenshots, and evidence

## Log Evidence


2026-03-24T20:27:29.979-05:00 [telegram] sendChatAction failed: Network request failed!
2026-03-24T20:27:32.595-05:00 typing TTL reached (2m); stopping typing indicator
2026-03-24T20:29:55.365-05:00 [gateway] signal SIGTERM received

Impact and severity

No response

Additional information

No response

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