openclaw - 💡(How to fix) Fix Bug: Telegram polling TELEGRAM_POLL_RESTART_POLICY too aggressive — maxMs=30s causes restart storms

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…

The TELEGRAM_POLL_RESTART_POLICY in dist/monitor-polling.runtime-*.js uses maxMs: 3e4 (30 seconds), which is too aggressive for network instability scenarios. During connectivity fluctuations, this causes rapid restart cycles that compound the problem rather than allowing graceful recovery.

Additionally:

  • Stop timeout has no circuit breaker — consecutive stop timeouts trigger immediate retries without cooldown
  • stopRunner/stopBot can be called repeatedly without deduplication, causing race conditions
  • Watchdog-triggered stops bypass the unified stop entry point

Root Cause

The TELEGRAM_POLL_RESTART_POLICY in dist/monitor-polling.runtime-*.js uses maxMs: 3e4 (30 seconds), which is too aggressive for network instability scenarios. During connectivity fluctuations, this causes rapid restart cycles that compound the problem rather than allowing graceful recovery.

Additionally:

  • Stop timeout has no circuit breaker — consecutive stop timeouts trigger immediate retries without cooldown
  • stopRunner/stopBot can be called repeatedly without deduplication, causing race conditions
  • Watchdog-triggered stops bypass the unified stop entry point

Code Example

const TELEGRAM_POLL_RESTART_POLICY = {
  initialMs: 2e3,  // 2s — too fast after a crash
  maxMs: 3e4,       // 30s — too short for network recovery
  factor: 1.8,
  jitter: .25
};

---

const TELEGRAM_POLL_RESTART_POLICY = {
  initialMs: 3e4,  // 30s — give network time to stabilize
  maxMs: 6e5,       // 10 min — max wait before next attempt
  factor: 2,
  jitter: .2
};
RAW_BUFFERClick to expand / collapse

Summary

The TELEGRAM_POLL_RESTART_POLICY in dist/monitor-polling.runtime-*.js uses maxMs: 3e4 (30 seconds), which is too aggressive for network instability scenarios. During connectivity fluctuations, this causes rapid restart cycles that compound the problem rather than allowing graceful recovery.

Additionally:

  • Stop timeout has no circuit breaker — consecutive stop timeouts trigger immediate retries without cooldown
  • stopRunner/stopBot can be called repeatedly without deduplication, causing race conditions
  • Watchdog-triggered stops bypass the unified stop entry point

Current Behavior (v2026.5.28)

const TELEGRAM_POLL_RESTART_POLICY = {
  initialMs: 2e3,  // 2s — too fast after a crash
  maxMs: 3e4,       // 30s — too short for network recovery
  factor: 1.8,
  jitter: .25
};

Suggested Fix

  1. Harden restart policy: Increase initialMs to 3e4 and maxMs to 6e5 (10 minutes), with factor: 2 for proper exponential backoff:
const TELEGRAM_POLL_RESTART_POLICY = {
  initialMs: 3e4,  // 30s — give network time to stabilize
  maxMs: 6e5,       // 10 min — max wait before next attempt
  factor: 2,
  jitter: .2
};
  1. Add stop-timeout circuit breaker: Track consecutive stop timeouts with burst counting; when threshold exceeded, apply exponential cooldown before next restart cycle.

  2. Add requestStop() deduplication: Ensure stopRunner() and stopBot() are called at most once per polling cycle.

  3. Add noteHealthyPollingCycle() tracking: Reset circuit breaker state after successful polling cycles.

Environment

  • OpenClaw version: 2026.5.28 (67ddc1a)
  • File: dist/monitor-polling.runtime-*.js
  • Related: #57422, #57544, #56096

References

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…

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 Bug: Telegram polling TELEGRAM_POLL_RESTART_POLICY too aggressive — maxMs=30s causes restart storms