Compare commits

...

2 Commits

Author SHA1 Message Date
Shakker
9c515824a3 fix(telegram): recover from grammY long-poll timeouts (#7466) (thanks @macmimi23) 2026-02-02 22:36:53 +00:00
mac mimi
6e563584ef fix(telegram): recover from grammY "timed out" long-poll errors (#7239)
grammY getUpdates returns "Request to getUpdates timed out after 500 seconds"
but RECOVERABLE_MESSAGE_SNIPPETS only had "timeout". Since
"timed out".includes("timeout") === false, the error was not classified as
recoverable, causing the polling loop to exit permanently.

Add "timed out" to RECOVERABLE_MESSAGE_SNIPPETS so the polling loop retries
instead of dying silently.

Fixes #7239
Fixes #7255
2026-02-02 22:25:02 +00:00
3 changed files with 7 additions and 0 deletions

View File

@@ -15,6 +15,7 @@ Docs: https://docs.openclaw.ai
- fix(agents): validate AbortSignal instances before calling AbortSignal.any() (#7277) (thanks @Elarwei001)
- fix(webchat): respect user scroll position during streaming and refresh (#7226) (thanks @marcomarandiz)
- Telegram: recover from grammY long-poll timed out errors. (#7466) Thanks @macmimi23.
- Media understanding: skip binary media from file text extraction. (#7475) Thanks @AlexZhangji.
- Security: guard skill installer downloads with SSRF checks (block private/localhost URLs).
- Media understanding: apply SSRF guardrails to provider fetches; allow private baseUrl overrides explicitly.

View File

@@ -40,6 +40,11 @@ describe("isRecoverableTelegramNetworkError", () => {
expect(isRecoverableTelegramNetworkError(new Error("invalid token"))).toBe(false);
});
it("detects grammY 'timed out' long-poll errors (#7239)", () => {
const err = new Error("Request to 'getUpdates' timed out after 500 seconds");
expect(isRecoverableTelegramNetworkError(err)).toBe(true);
});
// Grammy HttpError tests (issue #3815)
// Grammy wraps fetch errors in .error property, not .cause
describe("Grammy HttpError", () => {

View File

@@ -37,6 +37,7 @@ const RECOVERABLE_MESSAGE_SNIPPETS = [
"socket hang up",
"getaddrinfo",
"timeout", // catch timeout messages not covered by error codes/names
"timed out", // grammY getUpdates returns "timed out after X seconds" (not matched by "timeout")
];
function normalizeCode(code?: string): string {