Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@sibbl
Copy link
Contributor

@sibbl sibbl commented Jan 20, 2026

Refactor the matrix integration to utilize the matrix-bot-sdk, enabling end-to-end encryption and adhering to location, typing, and group concepts. Fix various room-related bugs in the process.

I decided not to enable end-to-end encryption by default, as it still comes with a few practical limitations for a bot like Clawdbot. In particular, encryption introduces additional operational complexity around key storage and recovery, requires explicit trust/verification from users, and can make debugging and observability significantly harder. There are also edge cases where bots miss messages or fail silently if keys aren’t shared correctly, which is a poor default experience.

@sibbl sibbl changed the title matrix(rewrite): integration for e2ee encryption rewrite(matrix): integration with e2ee encryption Jan 20, 2026
@sibbl sibbl changed the title rewrite(matrix): integration with e2ee encryption rewrite(matrix): integration with end to end encryption support Jan 20, 2026
@steipete
Copy link
Contributor

Awesome, thanks! I take over. Some notes from codex review:

  • BLOCKER: ESM require() in "type":"module" package → runtime crash.
    resolveCryptoStorePath/resolveStoragePath call require("node:os")/
    ("node:path"). extensions/matrix/src/matrix/client.ts:142.
  • MAJOR: Thread replies dropped. sendMessageMatrix computes threadId
    then never uses it / no m.relates_to thread relation. Replies will
    post in main room. extensions/matrix/src/matrix/send.ts:502.
  • MAJOR: Encrypted inbound media ignored. Only content.url handled;
    content.file never passed to downloadMatrixMedia, so E2EE
    attachments become text-only. extensions/matrix/src/matrix/monitor/
    index.ts:590.
  • MEDIUM: Auto-join allowlist regression: alt_aliases no longer
    checked (only canonical alias). extensions/matrix/src/matrix/
    monitor/auto-join.ts:34.
  • MEDIUM (risk): One-off clients (sendMessageMatrix w/o shared
    client) don’t crypto.prepare; E2EE rooms may look unencrypted or
    fail media encryption. extensions/matrix/src/matrix/send.ts:466.

Missing tests:

  • E2EE inbound media via content.file decryption.
  • Thread reply path (threadId → threaded send).

@steipete steipete force-pushed the matrix-with-e2ee-support branch from 8774a72 to e487765 Compare January 20, 2026 12:04
@steipete steipete merged commit 627fa30 into openclaw:main Jan 20, 2026
27 of 42 checks passed
@steipete
Copy link
Contributor

Landed via temp rebase onto main.

  • Gate: pnpm lint && pnpm build && pnpm test
  • Land commit: 627fa30
  • Merge commit: 627fa30

Thanks @sibbl!

@steipete
Copy link
Contributor

Landed follow-up fixes on main after rebase.

  • Gate: pnpm lint && pnpm build && pnpm test
  • Land commit: ${land_sha}
  • Merge commit: ${merge_sha}

Thanks @sibbl!

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