Skip to content

fix(matrix): handle encrypted media events and cache decrypted attachments - #3140

Closed
chalkers wants to merge 1 commit into
NousResearch:mainfrom
chalkers:fix/matrix-encrypted-media
Closed

fix(matrix): handle encrypted media events and cache decrypted attachments#3140
chalkers wants to merge 1 commit into
NousResearch:mainfrom
chalkers:fix/matrix-encrypted-media

Conversation

@chalkers

Copy link
Copy Markdown
Contributor

Summary

  • register Matrix encrypted media callbacks for image/audio/video/file events
  • download encrypted Matrix attachments through the authenticated client
  • decrypt encrypted media before handing it to downstream tools
  • cache decrypted images/audio/documents locally instead of relying on unusable MXC URLs
  • avoid falling back to ciphertext download URLs for encrypted media failures

Verification

  • source venv/bin/activate && python -m pytest tests/gateway/test_matrix.py -q

@chalkers
chalkers force-pushed the fix/matrix-encrypted-media branch from dccdd69 to d38a23d Compare April 1, 2026 23:19
teknium1 pushed a commit that referenced this pull request Apr 5, 2026
…ments

Cherry-picked from PR #3140 by chalkers, resolved against current main.
Registers RoomEncryptedImage/Audio/Video/File callbacks, decrypts
attachments via nio.crypto, caches all media types (images, audio,
documents), prevents ciphertext URL fallback for encrypted media.
Unifies the separate voice-message download into the main cache block.
Preserves main's MATRIX_REQUIRE_MENTION, auto-thread, and mention
stripping features. Includes 355 lines of encrypted media tests.
@teknium1

teknium1 commented Apr 5, 2026

Copy link
Copy Markdown
Contributor

Merged via PR #5271. Your implementation was salvaged onto current main with conflict resolution (preserving main's mention-gating and auto-thread features). Your authorship is preserved in git log. Thanks for the comprehensive encrypted media support!

@teknium1 teknium1 closed this Apr 5, 2026
teknium1 pushed a commit that referenced this pull request Apr 5, 2026
…ments

Cherry-picked from PR #3140 by chalkers, resolved against current main.
Registers RoomEncryptedImage/Audio/Video/File callbacks, decrypts
attachments via nio.crypto, caches all media types (images, audio,
documents), prevents ciphertext URL fallback for encrypted media.
Unifies the separate voice-message download into the main cache block.
Preserves main's MATRIX_REQUIRE_MENTION, auto-thread, and mention
stripping features. Includes 355 lines of encrypted media tests.
@chalkers
chalkers deleted the fix/matrix-encrypted-media branch April 5, 2026 22:39
Tommyeds pushed a commit to Tommyeds/hermes-agent that referenced this pull request Apr 12, 2026
…ments

Cherry-picked from PR NousResearch#3140 by chalkers, resolved against current main.
Registers RoomEncryptedImage/Audio/Video/File callbacks, decrypts
attachments via nio.crypto, caches all media types (images, audio,
documents), prevents ciphertext URL fallback for encrypted media.
Unifies the separate voice-message download into the main cache block.
Preserves main's MATRIX_REQUIRE_MENTION, auto-thread, and mention
stripping features. Includes 355 lines of encrypted media tests.
angelburgosrosado pushed a commit to angelburgosrosado/hermes-agent that referenced this pull request Apr 27, 2026
…ments

Cherry-picked from PR NousResearch#3140 by chalkers, resolved against current main.
Registers RoomEncryptedImage/Audio/Video/File callbacks, decrypts
attachments via nio.crypto, caches all media types (images, audio,
documents), prevents ciphertext URL fallback for encrypted media.
Unifies the separate voice-message download into the main cache block.
Preserves main's MATRIX_REQUIRE_MENTION, auto-thread, and mention
stripping features. Includes 355 lines of encrypted media tests.
02356abc pushed a commit to 02356abc/hermes-agent that referenced this pull request May 14, 2026
…ments

Cherry-picked from PR NousResearch#3140 by chalkers, resolved against current main.
Registers RoomEncryptedImage/Audio/Video/File callbacks, decrypts
attachments via nio.crypto, caches all media types (images, audio,
documents), prevents ciphertext URL fallback for encrypted media.
Unifies the separate voice-message download into the main cache block.
Preserves main's MATRIX_REQUIRE_MENTION, auto-thread, and mention
stripping features. Includes 355 lines of encrypted media tests.
gweeteve pushed a commit to gweeteve/hermes-agent that referenced this pull request Jun 2, 2026
…ments

Cherry-picked from PR NousResearch#3140 by chalkers, resolved against current main.
Registers RoomEncryptedImage/Audio/Video/File callbacks, decrypts
attachments via nio.crypto, caches all media types (images, audio,
documents), prevents ciphertext URL fallback for encrypted media.
Unifies the separate voice-message download into the main cache block.
Preserves main's MATRIX_REQUIRE_MENTION, auto-thread, and mention
stripping features. Includes 355 lines of encrypted media tests.
waefrebeorn pushed a commit to waefrebeorn/slermes that referenced this pull request Jul 2, 2026
…ments

Cherry-picked from PR NousResearch#3140 by chalkers, resolved against current main.
Registers RoomEncryptedImage/Audio/Video/File callbacks, decrypts
attachments via nio.crypto, caches all media types (images, audio,
documents), prevents ciphertext URL fallback for encrypted media.
Unifies the separate voice-message download into the main cache block.
Preserves main's MATRIX_REQUIRE_MENTION, auto-thread, and mention
stripping features. Includes 355 lines of encrypted media tests.
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.

2 participants