-
-
Notifications
You must be signed in to change notification settings - Fork 52.6k
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Summary
This commit broke Telegram Webhook incoming messages on startup. It causes a reproducible 1-2 minute pause in message handling at startup AND it may actually corrupt and lose portions of messages as well (still trying to validate):
It looks like that commit first went out in 2026.2.13
Steps to reproduce
- Configure Telegram
- Configure Webhook for Telegram
- Load this in a browser with your bot token for telegram:
https://api.telegram.org/bot<BOT_TOKEN>/getWebhookInfo - Load your webhook public URL (just a GET is fine - we just want to confirm we get a 404 and not a 502 after restart)
- Do a
/restartin a telegram chat - Wait until your public webhook gives a 404 (couple seconds) for a GET
- Immediately send a message in Telegram to the bot
- Refresh the
getWebhookInfopage to view the non-zero queued message count
Expected behavior
- Message should arrive at openclaw immediately in this case
- Disable the webhook mode and repeat the steps with polling - the message will arrive immediately and
typingwill be observed along with a quick response
Actual behavior
- Nothing happens for 1-2 minutes
- After the 1-2 minutes, the message arrives and
typingstarts to appear and response happens within a few seconds
OpenClaw version
2026.2.23
Operating system
macOS 26.2
Install method
npm global / pnpm gateway:watch
Logs, screenshots, and evidence
- Demonstrates immediate message receipt on startup with
polling - Demonstrates 1 minute delayed receipt on startup with
webhook - Demonstrates that removing the
guardfixes the issue and messages arrive immediately on startup withwebhook
Direct link: https://youtu.be/ixwb-LzCh1c
Impact and severity
Affected: Telegram Webhook users
Severity: Annoying + Possible Message Loss / Corruption
Frequency: Always (on Startup)
Consequence: Delays / Useless Troubleshooting / Possible Message Corruption
Additional information
To make the issue go away:
- Open
telegram/webhook.ts - Comment out the
guardinit and the other lines that referenceguard.- Clean easy to do in 1 minute - Repeat steps - Issue no longer happens
What I think is happening:
- I have run this in a debugger and the
guardis registeringon dataandon endevents as well as theon dataandon endevents in thegrammyhttphandler - This is either:
- Completely forbidden and we need to change the
grammyregistration tocallbackinstead ofhttpand eliminate the duplicate readers - in this case we likely are getting message loss / corruption when the guard swallows and discards the message beforegrammycan read it and/or we get interleaved reading where some is read by one and some by the other - Completely allowed and it's just a startup condition due to the
grammylisteners not being registered before we start listening on our port
- Completely forbidden and we need to change the
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
