fix(matrix): handle encrypted media in E2EE rooms - #4196
Closed
elkimek wants to merge 1 commit into
Closed
Conversation
In E2EE rooms, matrix-nio emits RoomEncryptedImage/Audio/Video/File events for media messages. These are distinct from MegolmEvent (used for encrypted text) and RoomMessageImage (used for unencrypted media). Previously, no callbacks were registered for these event types, so encrypted images, audio, video, and files were silently dropped. This commit: - Registers event callbacks for all four RoomEncrypted* media types - Extends isinstance checks in _on_room_message_media to match both encrypted and unencrypted variants - Decrypts attachment data after download using nio.crypto.decrypt_attachment before caching, so vision tools and other consumers receive valid files Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
19 tasks
7 tasks
kshitijk4poor
pushed a commit
that referenced
this pull request
Aug 25, 2026
Upstream OpenViking removed the uid-less viking://user/<segment> shorthand (#4196, merged 2026-08-21): reserved segments like memories and peers no longer expand to the caller's space and the server rejects them with HTTP 400 (NamespaceShapeError). First-party clients were migrated to viking://~ in the same change; the Hermes plugin was not (#91995). Migrate every URI the plugin constructs — the profile/preferences/ entities session-start reads, the _build_memory_uri memory-mirroring write path, and the tool-schema example — to viking://~/... README uid-less references updated to match; canonical user-scoped forms (viking://user/default/...) are unchanged. The ~ alias requires OpenViking server >= 0.4.16 (#4167).
prmartinow
pushed a commit
to prmartinow/hermes-agent
that referenced
this pull request
Aug 26, 2026
Upstream OpenViking removed the uid-less viking://user/<segment> shorthand (NousResearch#4196, merged 2026-08-21): reserved segments like memories and peers no longer expand to the caller's space and the server rejects them with HTTP 400 (NamespaceShapeError). First-party clients were migrated to viking://~ in the same change; the Hermes plugin was not (NousResearch#91995). Migrate every URI the plugin constructs — the profile/preferences/ entities session-start reads, the _build_memory_uri memory-mirroring write path, and the tool-schema example — to viking://~/... README uid-less references updated to match; canonical user-scoped forms (viking://user/default/...) are unchanged. The ~ alias requires OpenViking server >= 0.4.16 (NousResearch#4167).
and7777
pushed a commit
to and7777/hermes-agent
that referenced
this pull request
Aug 27, 2026
Upstream OpenViking removed the uid-less viking://user/<segment> shorthand (NousResearch#4196, merged 2026-08-21): reserved segments like memories and peers no longer expand to the caller's space and the server rejects them with HTTP 400 (NamespaceShapeError). First-party clients were migrated to viking://~ in the same change; the Hermes plugin was not (NousResearch#91995). Migrate every URI the plugin constructs — the profile/preferences/ entities session-start reads, the _build_memory_uri memory-mirroring write path, and the tool-schema example — to viking://~/... README uid-less references updated to match; canonical user-scoped forms (viking://user/default/...) are unchanged. The ~ alias requires OpenViking server >= 0.4.16 (NousResearch#4167).
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
RoomEncryptedImage/Audio/Video/Filefor these — distinct fromMegolmEvent(encrypted text) andRoomMessageImage(unencrypted media)Changes
RoomEncrypted*media typesisinstancechecks in_on_room_message_mediato match both encrypted and unencrypted variantsnio.crypto.decrypt_attachmentbefore cachingTest plan
Platforms tested
🤖 Generated with Claude Code