Skip to content

[Bug]: Telegram channel unhandled fetch failures crash entire gateway #3005

Description

@ryancontent

Summary

Unhandled promise rejections from Telegram API fetch failures crash the entire gateway, not just the Telegram channel. This kills all running agents and disconnects all channels.

Steps to reproduce

  1. Enable Telegram channel with valid bot token
  2. Run gateway during intermittent network conditions
  3. Observe full gateway crashes (not just channel restarts)

Expected behavior

Telegram API fetch failures should be caught and handled gracefully without affecting the gateway or other channels.

Actual behavior

Unhandled promise rejection causes the entire gateway to crash and restart:

  • All running agents are terminated mid-execution
  • All channel connections are dropped
  • Gateway must fully reinitialize

The crash cycle repeats with each fetch failure during network instability.

Environment

  • Clawdbot version: 2026.1.24-3
  • OS: Linux (arm64)
  • Install method: curl | sh
  • Node.js: v22.22.0
  • Telegram mode: polling

Logs or screenshots

Error immediately before crash:

[clawdbot] Unhandled promise rejection: TypeError: fetch failed
    at node:internal/deps/undici/undici:14902:13
    at processTicksAndRejections (node:internal/process/task_queues:105:5)

Followed by gateway restart indicators:

[gateway/canvas] canvas host mounted at http://127.0.0.1:18789/...
[gateway/heartbeat] heartbeat: started

This pattern repeats ~74 times in one day during network instability.

Impact

  • Running agents killed without graceful shutdown
  • All channels disconnected simultaneously
  • Session state may be lost

Related: #2876 (similar issue with setMyCommands during startup)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions