fix(telegram): #562 media-group uploads ignore chat_prefs-bound context#563
Merged
Nathan Schram (nathanschram) merged 1 commit intoMay 21, 2026
Merged
Conversation
Media-group (2+ file) uploads failed with "no project context available for file upload" on single-project DM deployments. _handle_media_group computed ambient_context from only topic_store + _topics_chat_project, never consulting the per-chat ChatPrefsStore — unlike the single-file path (loop.py:build_message_context), which has a topic-bound → chat_prefs → default fallback ladder. Thread chat_prefs through MediaGroupBuffer → _handle_media_group and mirror build_message_context's fallback ladder. Add a regression test. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This was referenced May 21, 2026
Closed
Nathan Schram (nathanschram)
added a commit
that referenced
this pull request
May 21, 2026
Adds a v0.35.3 ### fixes entry for the media-group file-upload bug fixed in #563. v0.35.3 is unreleased (not yet tagged), so this is the current changelog section, not a retroactive edit. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
Fixes #562 — media-group (2+ file) uploads failed with "no project context available for file upload" on single-project DM deployments (observed on the channelo VPS).
_handle_media_groupcomputedambient_contextfrom onlytopic_store+_topics_chat_project, never consulting the per-chatChatPrefsStore. The single-file path (loop.py:build_message_context) already has a topic-bound →chat_prefschat-bound → default fallback ladder; the media-group path was missing the middle rung. With nodefault_projectand nochat_mapentry, media groups resolvedambient_context=Noneand failed.Changes
commands/media.py—_handle_media_groupacceptschat_prefsand mirrorsbuild_message_context's fallback ladder (with a# keep in synccomment).loop.py—MediaGroupBuffer._flush_media_groupforwardsself._chat_prefstohandle_media_group.tests/test_telegram_media_command.py— regression test asserting media-group uploads resolve the chat_prefs-bound project.Testing
uv run pytest tests/test_telegram_media_command.py tests/test_telegram_file_transfer_helpers.py— 58 passeduv run pytest tests/test_loop_coverage.py tests/test_telegram_bridge.py— 116 passedruff check/ruff format --check— cleanIntegration testing (media-group upload via
@untether_dev_bot) to run as part of the next rc cycle per release-discipline.🤖 Generated with Claude Code