Repository navigation
Closed
Labels
P1High-priority user-facing bug, regression, or broken workflow.High-priority user-facing bug, regression, or broken workflow.clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.ClawSweeper needs live local, crabbox, or manual validation to confirm this issue.impact:crash-loopCrash, hang, restart loop, or process-level availability failure.Crash, hang, restart loop, or process-level availability failure.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.Channel message delivery can be lost, duplicated, or misrouted.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.Good issue quality with a plausible reproduction path needing some confirmation.
Description
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/stopBotcan 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
- Harden restart policy: Increase
initialMsto3e4andmaxMsto6e5(10 minutes), withfactor: 2for 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
};-
Add stop-timeout circuit breaker: Track consecutive stop timeouts with burst counting; when threshold exceeded, apply exponential cooldown before next restart cycle.
-
Add
requestStop()deduplication: EnsurestopRunner()andstopBot()are called at most once per polling cycle. -
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: telegram: improve polling outage detection and recovery after network loss #57422, fix(telegram): break repeated update replay storms #57544, Bug: Telegram sendChatAction infinite retry loop with no backoff #56096
References
- Exponential backoff best practices: https://aws.amazon.com/blogs/architecture/exponential-backoff-and-jitter/
- Circuit breaker pattern: https://learn.microsoft.com/azure/architecture/patterns/circuit-breaker
Reacted by clawsweeper
Metadata
Metadata
Assignees
Labels
P1High-priority user-facing bug, regression, or broken workflow.High-priority user-facing bug, regression, or broken workflow.clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.ClawSweeper needs live local, crabbox, or manual validation to confirm this issue.impact:crash-loopCrash, hang, restart loop, or process-level availability failure.Crash, hang, restart loop, or process-level availability failure.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.Channel message delivery can be lost, duplicated, or misrouted.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.Good issue quality with a plausible reproduction path needing some confirmation.
Type
Fields
Priority
None yet
Activity
clawsweeper commentedon May 30, 2026
Thanks for the context here. I did a careful shell check against current
main, and this is already implemented.Current main and shipped releases now implement the requested Telegram polling hardening: the restart policy is 30s/10m, repeated stop timeouts get a separate cooldown, stop requests are deduplicated, and healthy polling resets the backoff state. The June 9 follow-up overlaps with broader in-flight reply loss, but the specific polling restart-storm policy is already fixed by the merged Telegram polling PR.
I found the merged PR that appears to have closed this: #88832: fix(telegram): slow polling restart storms.
So I’m closing this as already implemented rather than keeping a duplicate issue open.
Review details
Best possible solution:
Keep the shipped Telegram polling restart hardening, and leave any broader in-flight reply-loss investigation to #78380 or a narrower delivery issue.
Do we have a high-confidence way to reproduce the issue?
No for current main: the old 2s/30s policy was source-reproducible in the pre-fix code and user logs, but current main and shipped release source now contain the requested 30s/10m policy and stop-timeout cooldown. I did not run a live Telegram network-flap reproduction in this read-only close pass.
Is this the best way to solve the issue?
Yes: the merged fix is in the TelegramPollingSession owner boundary, covers normal and isolated polling paths, and has focused tests for the policy, cooldown, dedupe, and reset behavior.
Security review:
Security review: Non-PR issue cleanup; no patch security or supply-chain review applies.
AGENTS.md: found and applied where relevant.
What I checked:
extensions/telegram/src/polling-session.ts:59, 1db8ab373422)extensions/telegram/src/polling-session.ts:1282, 1db8ab373422)extensions/telegram/src/polling-session.ts:411, 1db8ab373422)extensions/telegram/src/polling-session.test.ts:710, 8c802aa68351)extensions/telegram/src/polling-session.ts:53, 31828af1990e)Likely related people:
extensions/telegram/src/polling-session.ts,extensions/telegram/src/polling-session.test.ts)extensions/telegram/src/polling-session.ts,extensions/telegram/src/polling-session.test.ts)extensions/telegram/src/polling-session.ts)extensions/telegram/src/polling-session.ts,extensions/telegram/src/polling-session.test.ts)Codex review notes: model internal, reasoning high; reviewed against 1db8ab373422; fix evidence: merged PR #88832, release v2026.6.2-beta.1, commit 31828af1990e.
wangpuv commentedon Jun 9, 2026
Additional reproduction on v2026.6.1 (macOS, launchd):
Observed behavior:
auto-restart attempt 1/10→health-monitor restarting (reason: stopped)→auto-restart attempt 2/10within secondsisolated polling ingresssendMessagelog entries for those message IDs are completely absentEvidence:
Messages sent before 09:10 had
outbound send oklog. Messages during the restart window have zerosendMessageentries — the replies were generated by the agent but lost in the message pipeline.This aligns with both the aggressive restart policy reported in this issue and the in-flight message loss described in #78380.