openclaw - 💡(How to fix) Fix Telegram polling provider startup loops when deleteWebhook cleanup fails [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#73610Fetched 2026-04-29 06:17:28
View on GitHub
Comments
1
Participants
2
Timeline
2
Reactions
0
Author
Timeline (top)
commented ×1cross-referenced ×1

On Windows with OpenClaw 2026.4.26 (be8c246), enabling the Telegram channel can make the gateway intermittently unresponsive during startup because the Telegram polling runtime treats deleteWebhook cleanup failure as a setup retry loop.

This happens even when no Telegram webhook URL is configured and the intended mode is polling.

Error Message

When Telegram is enabled, gateway startup reaches Telegram provider startup and then logs errors like:

Root Cause

On Windows with OpenClaw 2026.4.26 (be8c246), enabling the Telegram channel can make the gateway intermittently unresponsive during startup because the Telegram polling runtime treats deleteWebhook cleanup failure as a setup retry loop.

Fix Action

Fix / Workaround

Current workaround

Code Example

telegram deleteWebhook failed: Network request for 'deleteWebhook' failed!
Telegram webhook cleanup failed: Network request for 'deleteWebhook' failed!; retrying in 3.69s.

---

Error: gateway timeout after 60000ms
Gateway target: ws://127.0.0.1:18790
Source: local loopback
Bind: loopback

---

Gateway Health
OK (~300ms)
Local loopback ws://127.0.0.1:18790
  Connect: ok (~25-40ms) · Capability: admin-capable · Read probe: ok

---

async #ensureWebhookCleanup(bot) {
  if (this.#webhookCleared) return "ready";
  try {
    await withTelegramApiErrorLogging({
      operation: "deleteWebhook",
      runtime: this.opts.runtime,
      fn: () => bot.api.deleteWebhook({ drop_pending_updates: false })
    });
    this.#webhookCleared = true;
    return "ready";
  } catch (err) {
    return await this.#waitBeforeRetryOnRecoverableSetupError(err, "Telegram webhook cleanup failed") ? "retry" : "exit";
  }
}

---

dist/extensions/telegram/monitor-polling.runtime-*.js
RAW_BUFFERClick to expand / collapse

Summary

On Windows with OpenClaw 2026.4.26 (be8c246), enabling the Telegram channel can make the gateway intermittently unresponsive during startup because the Telegram polling runtime treats deleteWebhook cleanup failure as a setup retry loop.

This happens even when no Telegram webhook URL is configured and the intended mode is polling.

Environment

  • OpenClaw: 2026.4.26 (be8c246)
  • OS: Windows 10.0.26200
  • Node runtime in logs: 24.14.1
  • Gateway bind: local loopback, port 18790
  • Telegram channel: channels.telegram.enabled=true
  • Telegram bot token/API basics were validated separately with Telegram API getMe and getWebhookInfo returning HTTP 200. Webhook URL was empty and pending updates were 0.

Observed behavior

When Telegram is enabled, gateway startup reaches Telegram provider startup and then logs errors like:

telegram deleteWebhook failed: Network request for 'deleteWebhook' failed!
Telegram webhook cleanup failed: Network request for 'deleteWebhook' failed!; retrying in 3.69s.

During this retry path, the gateway can become hard to probe from the CLI:

Error: gateway timeout after 60000ms
Gateway target: ws://127.0.0.1:18790
Source: local loopback
Bind: loopback

Keeping Telegram disabled and/or skipping channel startup restores gateway stability:

Gateway Health
OK (~300ms)
Local loopback ws://127.0.0.1:18790
  Connect: ok (~25-40ms) · Capability: admin-capable · Read probe: ok

Code path observed in the installed package

In the installed package, Telegram polling cleanup appears to unconditionally call deleteWebhook before polling can proceed:

async #ensureWebhookCleanup(bot) {
  if (this.#webhookCleared) return "ready";
  try {
    await withTelegramApiErrorLogging({
      operation: "deleteWebhook",
      runtime: this.opts.runtime,
      fn: () => bot.api.deleteWebhook({ drop_pending_updates: false })
    });
    this.#webhookCleared = true;
    return "ready";
  } catch (err) {
    return await this.#waitBeforeRetryOnRecoverableSetupError(err, "Telegram webhook cleanup failed") ? "retry" : "exit";
  }
}

Installed dist path:

dist/extensions/telegram/monitor-polling.runtime-*.js

I could not find a documented config/environment option to skip this cleanup step.

Expected behavior

For polling mode, deleteWebhook cleanup should not make the whole Telegram provider/gateway effectively unusable when it fails transiently.

Possible fixes:

  1. Add a documented option such as channels.telegram.skipWebhookCleanup or OPENCLAW_TELEGRAM_SKIP_WEBHOOK_CLEANUP=1.
  2. Treat deleteWebhook cleanup failure as non-fatal in polling mode after logging a warning, then continue to getUpdates.
  3. Only run cleanup when a webhook was actually configured or when getWebhookInfo shows an active webhook.

Current workaround

Keep Telegram disabled or skip channel startup. This keeps the gateway stable but makes Telegram unavailable.

Security note

No bot token, gateway token, or sender IDs are included here.

extent analysis

TL;DR

The gateway becomes unresponsive during startup when the Telegram channel is enabled due to the deleteWebhook cleanup failure being treated as a setup retry loop.

Guidance

  • The issue is caused by the deleteWebhook cleanup step in the Telegram polling runtime, which can fail and cause the gateway to become unresponsive.
  • To verify the issue, check the gateway logs for errors like "Telegram webhook cleanup failed" and "gateway timeout after 60000ms".
  • A possible mitigation is to keep Telegram disabled or skip channel startup, which restores gateway stability but makes Telegram unavailable.
  • Consider adding a configuration option to skip the deleteWebhook cleanup step, such as channels.telegram.skipWebhookCleanup or OPENCLAW_TELEGRAM_SKIP_WEBHOOK_CLEANUP=1.

Example

No code snippet is provided as the issue is related to the existing code in the dist/extensions/telegram/monitor-polling.runtime-*.js file.

Notes

The issue is specific to the OpenClaw version 2026.4.26 (be8c246) and the Telegram channel configuration.

Recommendation

Apply a workaround by keeping Telegram disabled or skipping channel startup until a fix is available, as this restores gateway stability.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

For polling mode, deleteWebhook cleanup should not make the whole Telegram provider/gateway effectively unusable when it fails transiently.

Possible fixes:

  1. Add a documented option such as channels.telegram.skipWebhookCleanup or OPENCLAW_TELEGRAM_SKIP_WEBHOOK_CLEANUP=1.
  2. Treat deleteWebhook cleanup failure as non-fatal in polling mode after logging a warning, then continue to getUpdates.
  3. Only run cleanup when a webhook was actually configured or when getWebhookInfo shows an active webhook.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix Telegram polling provider startup loops when deleteWebhook cleanup fails [1 comments, 2 participants]