mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 09:50:42 +00:00
fix(telegram): lower webhook callback timeout to 5s
#16763 added `onTimeout: "return"` with `timeoutMilliseconds: 10_000` (grammY default). In practice, Telegram's webhook servers abort the read well before 10s when handler latency is LLM-bound: `getWebhookInfo` reports `last_error_message: "Read timeout expired"` and pending updates pile up, cascading into multi-minute reply lag. Reproducible A/B on identical infra (same region, same bot token): - Minimal Python echo bot: 5 back-to-back webhook RTTs 341-642ms, clean. - OpenClaw current main: intermittent Read timeout expired, 1-5 min lag. The handler still runs to completion; only the Telegram-facing ack is sooner. grammY's deployment guide suggests 5s for long-running handlers. No new config surface; minimal one-line change to the existing constant and its test assertion. If a configurable timeout is wanted, that can be a follow-up (see stale #7754).
This commit is contained in:
committed by
Peter Steinberger
parent
e1341941d5
commit
43fc38e46c
@@ -455,7 +455,7 @@ describe("startTelegramWebhook", () => {
|
||||
{
|
||||
secretToken: TELEGRAM_SECRET,
|
||||
onTimeout: "return",
|
||||
timeoutMilliseconds: 10_000,
|
||||
timeoutMilliseconds: 5_000,
|
||||
},
|
||||
);
|
||||
expect(runtimeLog).toHaveBeenCalledWith(
|
||||
|
||||
@@ -28,7 +28,7 @@ import { createTelegramBot } from "./bot.js";
|
||||
|
||||
const TELEGRAM_WEBHOOK_MAX_BODY_BYTES = 1024 * 1024;
|
||||
const TELEGRAM_WEBHOOK_BODY_TIMEOUT_MS = 30_000;
|
||||
const TELEGRAM_WEBHOOK_CALLBACK_TIMEOUT_MS = 10_000;
|
||||
const TELEGRAM_WEBHOOK_CALLBACK_TIMEOUT_MS = 5_000;
|
||||
const InputFileCtor: typeof grammy.InputFile =
|
||||
typeof grammy.InputFile === "function"
|
||||
? grammy.InputFile
|
||||
|
||||
Reference in New Issue
Block a user