#7754: fix(telegram): configurable webhook timeout
channel: telegram
stale
Cluster:
Webhook Configuration and Resilience
## Summary
- Add `webhookTimeoutMs` config option for Telegram webhook
- Default to Infinity (no timeout) to allow long-running handlers
- Configure grammY with `onTimeout: "ignore"` for graceful handling
Fixes #7752
## Test plan
- [ ] Configure Telegram channel with `webhookTimeoutMs: 60000`
- [ ] Send a long voice message (>10 seconds)
- [ ] Verify audio transcription completes without timeout errors
- [ ] Verify webhook doesn't timeout during long processing
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
This PR introduces a new Telegram config option (`webhookTimeoutMs`) that is plumbed from config/types → Zod validation → provider monitor options → webhook server setup. The webhook handler is configured via `webhookCallback` with `onTimeout: "ignore"` and the timeout value wired from config/opts.
Overall the change is small and localized to Telegram’s webhook path, matching the existing config schema patterns in `src/config/zod-schema.providers-core.ts` and the runtime wiring in `src/telegram/monitor.ts`.
<h3>Confidence Score: 4/5</h3>
- This PR is likely safe to merge with low risk, with one potential behavioral edge case around using `Infinity` for the webhook timeout option.
- Changes are straightforward config plumbing and a small webhookCallback option update. The main concern is passing a non-finite value (`Infinity`) into a dependency option that may assume a finite millisecond timeout; if grammY uses timers internally, this could behave unexpectedly at runtime.
- src/telegram/webhook.ts
<!-- greptile_other_comments_section -->
<sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub>
**Context used:**
- Context from `dashboard` - CLAUDE.md ([source](https://app.greptile.com/review/custom-context?memory=fd949e91-5c3a-4ab5-90a1-cbe184fd6ce8))
- Context from `dashboard` - AGENTS.md ([source](https://app.greptile.com/review/custom-context?memory=0d0c8278-ef8e-4d6c-ab21-f5527e322f13))
<!-- /greptile_comment -->
Most Similar PRs
#6463: fix(telegram): improve timeout handling and prevent channel exits
by ai-fanatic · 2026-02-01
78.5%
#17918: fix(telegram): start webhook listener before setWebhook + forward w...
by Glucksberg · 2026-02-16
77.6%
#8067: fix(telegram): use timing-safe comparison for webhook secret
by yubrew · 2026-02-03
77.3%
#10865: telegram: fast-ACK webhook and retry bind on EADDRINUSE
by u9733037 · 2026-02-07
76.6%
#6447: fix(telegram): auto-restart polling when grammY runner exits silently
by AugmentAdvertise · 2026-02-01
75.1%
#13521: telegram: require webhook secret in runtime webhook mode
by davidahmann · 2026-02-10
74.6%
#5561: fix(telegram): auto-restart on timeout + lower API timeout to 60s
by jesseproudman · 2026-01-31
74.5%
#9577: feat: Add apiRoot option for custom Telegram Bot API server endpoint
by vfiee · 2026-02-05
73.9%
#22694: telegram: stabilize multi-account webhook mode
by Dongik · 2026-02-21
73.7%
#3186: fix(telegram): sanitize update offset + lock polling
by daxiong888 · 2026-01-28
73.7%