feat(telegram): use grammyjs/runner for concurrent update processing#366
Closed
mukhtharcm wants to merge 2 commits intoopenclaw:mainfrom
Closed
feat(telegram): use grammyjs/runner for concurrent update processing#366mukhtharcm wants to merge 2 commits intoopenclaw:mainfrom
mukhtharcm wants to merge 2 commits intoopenclaw:mainfrom
Conversation
Previously, grammY's default bot.start() processed updates sequentially, blocking all Telegram messages while one was being handled. This made maxConcurrent settings ineffective for Telegram. Now uses @grammyjs/runner which processes updates concurrently, matching the behavior of Discord (Promise.all) and WhatsApp (fire-and-forget). Benefits: - Ack reactions (👀) appear immediately, not after queue clears - Multiple chats can be processed in parallel - maxConcurrent setting now works correctly for Telegram - Long-running tool calls no longer block other conversations
9ffa470 to
519812b
Compare
Contributor
|
Landed via fast-forward on main. Added per-chat sequentialization + runner concurrency cap + tests + changelog, plus a small typebox schema mismatch fix to keep builds green. Commits: 47e4bf8ca, f6051eea0, e27db4083, 7f9de5aea. |
dgarson
added a commit
to dgarson/clawdbot
that referenced
this pull request
Feb 9, 2026
…ls, gateway wiring) (openclaw#366) * Obsidian: add vault integration scaffolding * Obsidian: update link index before filtering self-authored
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Telegram message processing was completely sequential, blocking all messages while one was being handled. This made the
maxConcurrentconfig setting ineffective for Telegram users.Root Cause
grammY's default
bot.start()uses sequential update processing:This meant:
How Other Providers Handle This
Promise.all(listeners.map(...))void task.catch(...)(fire-and-forget)await handleUpdate()in for-loopDiscord and WhatsApp already processed messages in parallel. Only Telegram was affected.
Visual Example
Before (sequential):
After (concurrent with runner):
Solution
Use
@grammyjs/runnerwhich is the official grammY plugin for concurrent update processing.Changes
@grammyjs/runnerdependencybot.start()withrun(bot)insrc/telegram/monitor.tsCode Change
Benefits
maxConcurrentsetting now works for TelegramTesting
Tested on dev container with:
Related
This was discovered while investigating why ack reactions were delayed. The deeper issue was that the entire Telegram provider was single-threaded.