Skip to content

fix(telegram): #562 media-group uploads ignore chat_prefs-bound context#563

Merged
Nathan Schram (nathanschram) merged 1 commit into
devfrom
fix/media-group-chat-prefs-context
May 21, 2026
Merged

fix(telegram): #562 media-group uploads ignore chat_prefs-bound context#563
Nathan Schram (nathanschram) merged 1 commit into
devfrom
fix/media-group-chat-prefs-context

Conversation

@nathanschram
Copy link
Copy Markdown
Member

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_group computed ambient_context from only topic_store + _topics_chat_project, never consulting the per-chat ChatPrefsStore. The single-file path (loop.py:build_message_context) already has a topic-bound → chat_prefs chat-bound → default fallback ladder; the media-group path was missing the middle rung. With no default_project and no chat_map entry, media groups resolved ambient_context=None and failed.

Changes

  • commands/media.py_handle_media_group accepts chat_prefs and mirrors build_message_context's fallback ladder (with a # keep in sync comment).
  • loop.pyMediaGroupBuffer._flush_media_group forwards self._chat_prefs to handle_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 passed
  • uv run pytest tests/test_loop_coverage.py tests/test_telegram_bridge.py — 116 passed
  • ruff check / ruff format --check — clean

Integration testing (media-group upload via @untether_dev_bot) to run as part of the next rc cycle per release-discipline.

🤖 Generated with Claude Code

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>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 21, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 240de5d6-c215-42a8-9705-faded2770f16

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/media-group-chat-prefs-context

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@nathanschram Nathan Schram (nathanschram) merged commit a9df9c8 into dev May 21, 2026
21 checks passed
@nathanschram Nathan Schram (nathanschram) deleted the fix/media-group-chat-prefs-context branch May 21, 2026 02:02
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant