From 95c6b3a912a1a02b70913df5e6d7bdabed32cb24 Mon Sep 17 00:00:00 2001 From: sten moocow Date: Wed, 25 Feb 2026 06:58:58 -0500 Subject: [PATCH] fix(telegram): recover polling after prolonged network outages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When grammY's runner exceeds maxRetryTime during a network outage, runner.task() resolves cleanly. Previously, the polling loop treated this as an intentional stop and exited permanently — killing Telegram polling for the lifetime of the gateway process. Now the outer loop detects this case and restarts with exponential backoff, so polling recovers once connectivity is restored. Also bumps maxRetryTime from 5 minutes to 60 minutes so the runner itself survives longer outages (e.g. scheduled internet downtime) without needing the outer loop restart path. --- src/telegram/monitor.ts | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/telegram/monitor.ts b/src/telegram/monitor.ts index 8637f488dd6..8c93eee60c9 100644 --- a/src/telegram/monitor.ts +++ b/src/telegram/monitor.ts @@ -45,8 +45,10 @@ export function createTelegramRunnerOptions(cfg: OpenClawConfig): RunOptions