← Back to PRs

#7754: fix(telegram): configurable webhook timeout

by djmango open 2026-02-03 05:30 View on GitHub →
channel: telegram stale
## 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