fix(telegram): route forwarded channel media through effective_message (#76615) - #76758
Closed
Enough1122 wants to merge 1 commit into
Closed
fix(telegram): route forwarded channel media through effective_message (#76615)#76758Enough1122 wants to merge 1 commit into
Enough1122 wants to merge 1 commit into
Conversation
NousResearch#76615) _handle_media_message guarded on update.message and exited silently when it was None. Media forwarded from channels arrives with the payload on update.effective_message (update.message is None), so forwarded photos and documents were never delivered to the agent. Mirror the text handler: resolve msg = self._effective_update_message(update) at the top and use it for auth/should-process/observe checks. Also set effective_message explicitly in the test helper so mocks match python-telegram-bot semantics (a MagicMock attribute access would return an auto-mock and silently break effective-message routing).
Collaborator
Contributor
|
Thanks for addressing a real Telegram media-routing regression. Problems
Suggested changes
Automated hermes-sweeper review. |
Contributor
Author
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
_handle_media_messageguarded onupdate.messageand returned silently when it wasNone. Media forwarded from channels arrives with the real payload onupdate.effective_message(update.messageisNone), so forwarded photos/documents were never delivered to the agent — no log, no error.Fix: resolve
msg = self._effective_update_message(update)at the top (mirroring the text handler at ~line 8695) and use it for the auth / should-process / observe checks. The rest of the function already worked off amsgvariable.Also fixed the test helper to set
effective_messageexplicitly (MagicMock would otherwise return an auto-mock, silently breaking effective-message routing).Single-file change (plus tests). No public API change.
NOT doing X: not touching
_handle_text_message(already correct), not changing download/cache flow.Test plan