Skip to content

[Bug]: Telegram long-polling connection dies after ~8 minutes without auto-reconnect #7526

@alexgalbraith

Description

@alexgalbraith

Summary

The Telegram channel plugin stops receiving messages after ~8 minutes when the long-polling connection times out. The plugin does not auto-reconnect, requiring manual gateway restarts to restore functionality.

Steps to reproduce

  1. Configure OpenClaw with Telegram channel enabled (long-polling mode, not webhooks)
  2. Start the gateway and send a test message (verify bot responds)
  3. Wait ~8-10 minutes without interaction
  4. Send another message to the bot
  5. Observe that the bot does not respond
  6. Check openclaw status - shows Telegram as "OK"
  7. Check Telegram API getWebhookInfo endpoint - pending_update_count will be > 0

Expected behavior

The Telegram plugin should automatically reconnect when the long-polling connection times out, maintaining continuous message delivery without manual intervention.

Actual behavior

  • Long-polling connection times out after ~500 seconds (~8.3 minutes)
  • Plugin does not reconnect
  • Messages queue on Telegram's side (visible as pending updates)
  • openclaw status shows channel as "OK" (API is reachable, but polling loop is dead)
  • Bot remains unresponsive until gateway is manually restarted

Environment

  • OpenClaw version: 2026.1.30
  • OS: macOS (likely affects all platforms)
  • Install method: pnpm (global install)

Logs or screenshots

No error logs are generated when polling stops. The connection silently dies without logging a failure.

After adding retry policy to config:

{
  "channels": {
    "telegram": {
      "retry": {
        "attempts": 5,
        "minDelayMs": 1000,
        "maxDelayMs": 10000,
        "jitter": 0.3
      }
    }
  }
}

Result: 23+ hours continuous operation, zero timeouts, zero restarts required.

Proposed Fix

Make retry policy the default for Telegram channel configuration. This converts a hard failure (polling dies, manual restart needed) into a self-healing transient failure (exponential backoff reconnection).

Suggested Default Config

{
  "channels": {
    "telegram": {
      "retry": {
        "attempts": 5,
        "minDelayMs": 1000,
        "maxDelayMs": 10000,
        "jitter": 0.3
      }
    }
  }
}

This would make the Telegram integration production-ready out of the box without requiring users to implement external health monitoring scripts.

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