Skip to content

fix(matrix): route text-only send_message through adapter for E2EE support - #185

Merged
hashbender merged 1 commit into
mainfrom
mirror/pr-56106
Jul 1, 2026
Merged

fix(matrix): route text-only send_message through adapter for E2EE support#185
hashbender merged 1 commit into
mainfrom
mirror/pr-56106

Conversation

@hashbender

Copy link
Copy Markdown
Owner

Summary

Text-only Matrix messages sent via the send_message engine (hermes send, cron deliver: matrix) now arrive encrypted in E2EE rooms instead of cleartext (red padlock).

Root cause: media sends already routed through the mautrix adapter (_send_matrix_via_adapter), which encrypts. Text-only sends took the raw-HTTP standalone_sender_fn path, which never encrypts — so text landed unencrypted in E2EE rooms.

Changes

The plugin's standalone_sender_fn stays registered for the registry contract; it is simply no longer reached for Matrix.

Validation

Before After
Text-only send in E2EE room raw HTTP m.text → cleartext (red padlock) mautrix adapter → encrypted
Media send in E2EE room adapter → encrypted adapter → encrypted (unchanged)
Targeted tests 169/169 pass
E2E routing check text → standalone raw-HTTP text → _send_matrix_via_adapter, raw-HTTP bypassed

Salvaged from NousResearch#20259 (@DanAsBjorn, first submitter) onto current main. The original patched the pre-NousResearch#41112 _send_matrix branch, which had since moved to the plugin's standalone path — same fix direction, re-applied to the current structure. Duplicate NousResearch#23382 (@32r4) fixed the same routing layer with an encryption-flag gate; the unconditional route is simpler and correct since the adapter sends plaintext to unencrypted rooms fine.

Infographic

mission patch


Mirror-of: NousResearch#56106
NousResearch#56106

@tenki-reviewer

tenki-reviewer Bot commented Jul 1, 2026

Copy link
Copy Markdown

Review Complete
No issues found!

Risk: 🟢 Low (12/100) — no findings · 33 LOC across 2 files


Routes all Matrix sends through the E2EE-capable adapter instead of the raw-HTTP standalone path, fixing cleartext text-only messages that showed a red padlock in encrypted rooms.

Files Reviewed (2 files)
tests/tools/test_send_message_tool.py
tools/send_message_tool.py

@hashbender
hashbender merged commit 37f9181 into main Jul 1, 2026
3 checks passed
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