Repository navigation
fix(telegram): stop dropping voice messages on getFile network errors (#16136) - #16154
Merged
obviyus merged 2 commits intoFeb 15, 2026
Merged
Conversation
yinghaosang
force-pushed
the
fix/telegram-voice-getfile-retry
branch
from
February 14, 2026 10:45
9956dad to
f2f0879
Compare
obviyus
force-pushed
the
fix/telegram-voice-getfile-retry
branch
from
February 15, 2026 09:19
f2f0879 to
fbcd784
Compare
Collaborator
|
Merged via squash. Thanks @yinghaosang! |
GwonHyeok
pushed a commit
to learners-superpumped/openclaw
that referenced
this pull request
Feb 15, 2026
…openclaw#16136) (openclaw#16154) Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: fbcd784 Co-authored-by: yinghaosang <[email protected]> Co-authored-by: obviyus <[email protected]> Reviewed-by: @obviyus
This was referenced Feb 17, 2026
6 tasks
lovewanwan
pushed a commit
to lovewanwan/openclaw
that referenced
this pull request
Apr 28, 2026
…openclaw#16136) (openclaw#16154) Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: fbcd784 Co-authored-by: yinghaosang <[email protected]> Co-authored-by: obviyus <[email protected]> Reviewed-by: @obviyus
ogt-redknie
pushed a commit
to ogt-redknie/OPENX
that referenced
this pull request
May 2, 2026
…openclaw#16136) (openclaw#16154) Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: fbcd784 Co-authored-by: yinghaosang <[email protected]> Co-authored-by: obviyus <[email protected]> Reviewed-by: @obviyus
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
May 9, 2026
…openclaw#16136) (openclaw#16154) Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: fbcd784 Co-authored-by: yinghaosang <[email protected]> Co-authored-by: obviyus <[email protected]> Reviewed-by: @obviyus
lhfer
pushed a commit
to lhfer/openclaw
that referenced
this pull request
Oct 11, 2026
…openclaw#16136) (openclaw#16154) Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: fbcd784 Co-authored-by: yinghaosang <[email protected]> Co-authored-by: obviyus <[email protected]> Reviewed-by: @obviyus
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.
Summary
Voice messages (and all non-sticker media) get lost when the Telegram
getFileAPI call hits a network error. The sticker path already has a try/catch that returnsnullgracefully, but the non-sticker media path inresolveMediajust lets the exception bubble up — it reaches the outer catch inbot-handlers.tswhich logs and drops the message.Closes #16136
lobster-biscuit
Root Cause
resolveMedia()indelivery.tscallsctx.getFile()with no retry and no error handling for non-sticker media (voice, photo, video, audio, document). On network failure, the error propagates tobot-handlers.ts:884where only the "exceeds MB limit" case is caught — everything else gets re-thrown and the outer catch at line 933 swallows it. Message gone, no feedback.Changes
getFile()call, network error → message droppedretryAsyncfromsrc/infra/retry.ts. If all retries fail, returnsnullinstead of throwing — the message still reaches the agent with a type-based placeholder (e.g.<media:audio>) frombot-message-context.tsOnly
delivery.tsis changed. The retry catch is scoped togetFileonly — downstream errors fromfetchRemoteMedia/saveMediaBufferstill throw normally.Tests
New file:
delivery.resolve-media-retry.test.ts(5 tests, fake timers):All 50 telegram test files (419 tests) pass.
pnpm build && pnpm checkclean (pre-existing format issue in.agents/skills/find-issue/SKILL.mdonly).Greptile Overview
Greptile Summary
This PR contains two separate fixes that improve reliability in different parts of the system. The telegram fix adds retry logic with exponential backoff (3 attempts, 1s/2s/4s delays) for the
getFileAPI call when processing non-sticker media (voice, photo, video, audio, document). Previously, network errors would cause messages to be dropped at the outer catch handler inbot-handlers.ts:933. Now, if all retries fail,resolveMediareturnsnullinstead of throwing, allowing the message to reach the agent with a type-based placeholder (e.g.,<media:audio>). The agents fix addresses a race condition where asynconBlockReplyFlushcallbacks were not awaited before subsequent events were processed, causing tool messages to potentially overtake narration delivery. The fix serializes events through a promise chain when a flush callback is present, ensuring delivery completes before tool execution proceeds.retryAsyncwrapper aroundctx.getFile()indelivery.ts:406-414with exponential backoff for non-sticker medianullon retry exhaustion instead of throwing, preventing message lossdelivery.resolve-media-retry.test.ts(5 tests with fake timers)pi-embedded-subscribe.handlers.tsto serialize events through a promise chain when flush is in-flighthandleToolExecutionStartto awaitonBlockReplyFlush()with try-catch for best-effort deliveryConfidence Score: 5/5
retryAsyncutility correctly and degrades gracefully on failure. The agents fix properly serializes async operations without breaking the event handler chain. No logic errors, security issues, or breaking changes detected.Last reviewed commit: 9956dad