fix: handle Telegram channel media posts - #35720
Conversation
|
Thanks - yes, this overlaps with #28614 and #28813. I opened this because the issue is still present on current Happy to close this if maintainers prefer to revive one of the earlier PRs. |
tonydwb
left a comment
There was a problem hiding this comment.
Code Review Summary
Verdict: Approved
Overview
Well-scoped fix for Telegram channel media posts being dropped. The media handler used update.message directly instead of the effective-message helper that the text path already uses. Channel posts arrive as update.channel_post / effective_message, so they were silently dropped.
Looks Good
- Fixes a clear bug: channel media posts bypassing the entire media pipeline
- Uses the existing
_effective_update_message()helper (consistent with text path) - Good regression test coverage with channel post scenario
- No observable side effects for non-channel messages
Reviewed by Hermes Agent
9913934 to
4f4a40c
Compare
|
For maintainers comparing with #28614 / #28813 / #29753: This PR takes the same shared-handler approach — normalize with I intentionally avoided the older #3683-style separate channel media handler, because duplicating Telegram media caching/dispatch logic would make channel posts drift from the regular media path over time. Scope-wise this should cover Telegram channel posts for the existing supported media/document branches, subject to the current allowlists and size limits. |
4f4a40c to
d6d10b9
Compare
teknium1
left a comment
There was a problem hiding this comment.
Thanks for identifying a real Telegram channel-media gap. The underlying bug is still present on current main, but this PR no longer targets the live implementation.
Problems
gateway/platforms/telegram.pywas renamed toplugins/platforms/telegram/adapter.pyby560010547; the current handler still returns onupdate.message is Noneatplugins/platforms/telegram/adapter.py:7764. GitHub consequently reports this PR as conflicting.- The live handler now also has an authorization guard at
plugins/platforms/telegram/adapter.py:7766-7772; a salvage should normalize tomsgbefore that guard and use it throughout the processing and observe branches. tests/gateway/test_telegram_channel_posts.py:151-181covers channel text and commands, not media routing.
Suggested changes
- Port this same effective-message normalization to the bundled plugin handler and add a channel-post media regression there.
Automated hermes-sweeper review.
| Telegram channel posts arrive as ``update.channel_post`` rather than | ||
| ``update.message``. Use the same effective-message helper as the text | ||
| path so channel-uploaded supported files and media are cached and dispatched | ||
| instead of being dropped before plugins can see them. |
There was a problem hiding this comment.
Current main relocated this adapter to plugins/platforms/telegram/adapter.py in 560010547; this PR therefore conflicts and this change does not reach the live handler. Salvage the normalization into the plugin handler, including its current authorization guard.
Summary
update.messageis absent.Why
Telegram channel posts arrive as
update.channel_post/effective_message, notupdate.message. The media handler returned early before plugins could see uploaded documents.Test Plan
/Users/nick/.hermes/hermes-agent/venv/bin/python -m pytest tests/gateway/test_telegram_group_gating.py -q -o 'addopts='