Repository navigation
fix(telegram): initialize isolated polling bot - #81975
Conversation
|
Codex review: needs maintainer review before merge. Summary Reproducibility: yes. Source inspection shows current main can call Real behavior proof Next step before merge Security Review detailsBest possible solution: Land the narrow Telegram initialization fix after normal PR checks and maintainer review, then close #81973 through the merged PR. Do we have a high-confidence way to reproduce the issue? Yes. Source inspection shows current main can call Is this the best way to solve the issue? Yes. Calling grammY's idempotent What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 916fc3d09ae1. |
|
Updated the PR body with redacted real Slack bot-to-bot QA proof from this branch:
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Added Telegram-specific proof to the PR body. Redacted local proof from this PR checkout:
@clawsweeper re-review |
Co-authored-by: Cursor <[email protected]>
Co-authored-by: Cursor <[email protected]>
cbba677 to
13a4d0e
Compare
|
Verification for maintainer merge: Behavior addressed: Telegram isolated polling now initializes the grammY bot before the isolated ingress worker drains spooled updates, so Local proof on PR head Observed result after fix: focused Telegram polling regression passes; prod types, test types, Telegram package-boundary compile, and whitespace check pass locally. CI proof on PR head Known proof gaps: no new live Telegram token run by me; PR body and issue comments include redacted real deployment proof showing isolated polling starts, Telegram replies send, and no |
Summary
handleUpdate.Root Cause
Isolated polling ingress bypasses
@grammyjs/runnerand dispatches spooled updates directly throughbot.handleUpdate(update). grammY requiresbot.init()or constructorbotInfobeforehandleUpdate; most polling bots are created withoutbotInfo, so isolated ingress could repeatedly fail withBot not initialized!and leave spool files in place.Linked Issue
Fixes #81973.
Why This Is Safe
bot.init()is grammY's normal initialization path and is idempotent when bot info is already available. The change runs only in the isolated-ingress path, before the worker and drain timer start, and reuses the existing recoverable setup retry behavior.Security / Runtime Controls
Security posture and runtime policy are unchanged. This does not change Telegram token handling, webhook cleanup policy, ingress spool file ownership, message filtering, command authorization, or prompt text; it only initializes the existing bot instance before dispatching updates.
Real Behavior Proof
Behavior addressed: isolated polling ingress no longer calls
handleUpdateon an uninitialized grammY bot.Real environment tested: local PR checkout/package
OpenClaw 2026.5.14 (cbba677)with a real Telegram bot token from local env, public Telegram config, and default isolated polling ingress.Exact steps or command run after this patch: verified Bot API
getMe; ran focused Telegram tests; attempted the official direct Telegram QA env lane; then started the PR gateway withTELEGRAM_BOT_TOKENand sent a real Telegram/statusDM to the bot.Evidence after fix: redacted runtime log and terminal output from a real Telegram gateway run after this patch:
Observed result after fix: Telegram isolated polling initialized the grammY bot, processed the inbound update, and sent a Telegram reply successfully.
What was not tested: the official bot-to-bot
openclaw qa telegramlane did not run from this local env because it requiresOPENCLAW_QA_TELEGRAM_GROUP_IDplus distinct driver/SUT bot tokens; the provided env had only the SUT-styletelegram_bot_token.Out Of Scope
AI-assisted: yes.
Made with Cursor