23. Matrix (plagin)¶
-
Matrix — ochiq, markazlashtirilmagan xabar almashish protokoli. 25. OpenClaw Matrix foydalanuvchisi sifatida istalgan homeserverda ulanadi, shuning uchun bot uchun Matrix hisobi kerak. 26. Tizimga kirgach, botga bevosita DM yuborishingiz yoki uni xonalarga (Matrix "guruhlar") taklif qilishingiz mumkin. 27. Beeper ham yaroqli mijoz variantidir, ammo u E2EE yoqilgan bo‘lishini talab qiladi.
-
Holat: plagin orqali qo‘llab-quvvatlanadi (@vector-im/matrix-bot-sdk). 29. To‘g‘ridan-to‘g‘ri xabarlar, xonalar, mavzular (threads), media, reaksiyalar, so‘rovlar (yuborish + poll-start matn sifatida), joylashuv va E2EE (kriptografik qo‘llab-quvvatlash bilan).
30. Plagin talab qilinadi¶
-
Matrix plagin sifatida yetkazib beriladi va asosiy o‘rnatmaga kiritilmagan.
-
CLI orqali o‘rnating (npm registri):
33. openclaw plugins install @openclaw/matrix
- Lokal checkout (git repodan ishga tushirilganda):
35. openclaw plugins install ./extensions/matrix
-
Agar konfiguratsiya/onboarding vaqtida Matrix’ni tanlasangiz va git checkout aniqlansa, OpenClaw lokal o‘rnatish yo‘lini avtomatik taklif qiladi.
-
Tafsilotlar: Plugins
38. Sozlash¶
-
- Matrix plaginini o‘rnating:
- 40. npm’dan:
openclaw plugins install @openclaw/matrix- 41. Lokal checkout’dan:openclaw plugins install ./extensions/matrix
- Matrix plaginini o‘rnating:
- 40. npm’dan:
-
- Homeserverda Matrix hisobini yarating: - 43. Hosting variantlarini ko‘rib chiqing: https://matrix.org/ecosystem/hosting/ - 44. Yoki uni o‘zingiz joylashtiring.
-
- Bot hisobi uchun access token oling:
-
- O‘z homeserveringizda
curlorqali Matrix login API’dan foydalaning:
- O‘z homeserveringizda
bash
47. curl --request POST \
--url https://matrix.example.org/_matrix/client/v3/login \
--header 'Content-Type: application/json' \
--data '{
"type": "m.login.password",
"identifier": {
"type": "m.id.user",
"user": "your-user-name"
},
"password": "your-password"
}'
-
matrix.example.orgni homeserver URL’ingiz bilan almashtiring.
-
- Yoki
channels.matrix.userId+channels.matrix.passwordni sozlang: OpenClaw xuddi shu login endpoint’ini chaqiradi, access token’ni~/.openclaw/credentials/matrix/credentials.jsonga saqlaydi va keyingi ishga tushirishda undan qayta foydalanadi.
- Yoki
-
- Hisob ma’lumotlarini sozlash:
- Env:
MATRIX_HOMESERVER,MATRIX_ACCESS_TOKEN(orMATRIX_USER_ID+MATRIX_PASSWORD) - Or config:channels.matrix.*- If both are set, config takes precedence. - With access token: user ID is fetched automatically via/whoami. - When set,channels.matrix.userIdshould be the full Matrix ID (example:@bot:example.org).
- Hisob ma’lumotlarini sozlash:
- Env:
-
Restart the gateway (or finish onboarding).
-
Start a DM with the bot or invite it to a room from any Matrix client (Element, Beeper, etc.; see https://matrix.org/ecosystem/clients/). Beeper requires E2EE, so set
channels.matrix.encryption: trueand verify the device.
Minimal config (access token, user ID auto-fetched):
{
channels: {
matrix: {
enabled: true,
homeserver: "https://matrix.example.org",
accessToken: "syt_***",
dm: { policy: "pairing" },
},
},
}
E2EE config (end to end encryption enabled):
{
channels: {
matrix: {
enabled: true,
homeserver: "https://matrix.example.org",
accessToken: "syt_***",
encryption: true,
dm: { policy: "pairing" },
},
},
}
Encryption (E2EE)¶
End-to-end encryption is supported via the Rust crypto SDK.
Enable with channels.matrix.encryption: true:
- If the crypto module loads, encrypted rooms are decrypted automatically.
- Outbound media is encrypted when sending to encrypted rooms.
- On first connection, OpenClaw requests device verification from your other sessions.
- Verify the device in another Matrix client (Element, etc.) to enable key sharing.
- If the crypto module cannot be loaded, E2EE is disabled and encrypted rooms will not decrypt; OpenClaw logs a warning.
- If you see missing crypto module errors (for example,
@matrix-org/matrix-sdk-crypto-nodejs-*), allow build scripts for@matrix-org/matrix-sdk-crypto-nodejsand runpnpm rebuild @matrix-org/matrix-sdk-crypto-nodejsor fetch the binary withnode node_modules/@matrix-org/matrix-sdk-crypto-nodejs/download-lib.js.
Crypto state is stored per account + access token in
~/.openclaw/matrix/accounts/<account>/<homeserver>__<user>/<token-hash>/crypto/
(SQLite database). Sync state lives alongside it in bot-storage.json.
If the access token (device) changes, a new store is created and the bot must be
re-verified for encrypted rooms.
Device verification: When E2EE is enabled, the bot will request verification from your other sessions on startup. Open Element (or another client) and approve the verification request to establish trust. Once verified, the bot can decrypt messages in encrypted rooms.
Routing model¶
- Replies always go back to Matrix.
- DMs share the agent's main session; rooms map to group sessions.
Access control (DMs)¶
- Default:
channels.matrix.dm.policy = "pairing". Unknown senders get a pairing code. - Approve via:
openclaw pairing list matrixopenclaw pairing approve matrix <CODE>- Public DMs:
channels.matrix.dm.policy="open"pluschannels.matrix.dm.allowFrom=["*"]. channels.matrix.dm.allowFromaccepts full Matrix user IDs (example:@user:server). The wizard resolves display names to user IDs when directory search finds a single exact match.
Rooms (groups)¶
- Default:
channels.matrix.groupPolicy = "allowlist"(mention-gated). Usechannels.defaults.groupPolicyto override the default when unset. - Allowlist rooms with
channels.matrix.groups(room IDs or aliases; names are resolved to IDs when directory search finds a single exact match):
{
channels: {
matrix: {
groupPolicy: "allowlist",
groups: {
"!roomId:example.org": { allow: true },
"#alias:example.org": { allow: true },
},
groupAllowFrom: ["@owner:example.org"],
},
},
}
requireMention: falseenables auto-reply in that room.groups."*"can set defaults for mention gating across rooms.groupAllowFromrestricts which senders can trigger the bot in rooms (full Matrix user IDs).- Per-room
usersallowlists can further restrict senders inside a specific room (use full Matrix user IDs). - The configure wizard prompts for room allowlists (room IDs, aliases, or names) and resolves names only on an exact, unique match.
-
- Ishga tushishda OpenClaw allowlistlardagi xona/foydalanuvchi nomlarini IDlarga moslaydi va moslikni logga yozadi; aniqlanmagan yozuvlar allowlist moslashtirishida e’tiborga olinmaydi.
-
- Takliflar odatda avtomatik qo‘shiladi;
channels.matrix.autoJoinvachannels.matrix.autoJoinAllowlistorqali boshqariladi.
- Takliflar odatda avtomatik qo‘shiladi;
-
- Hech qanday xonaga ruxsat bermaslik uchun
channels.matrix.groupPolicy: "disabled"qilib qo‘ying (yoki allowlistni bo‘sh qoldiring).
- Hech qanday xonaga ruxsat bermaslik uchun
-
- Meros kalit:
channels.matrix.rooms(groupsbilan bir xil tuzilma).
- Meros kalit:
5. Tredlar¶
- Reply threading is supported.
-
channels.matrix.threadRepliesjavoblar tredlarda qolishini boshqaradi:
off,inbound(default),alwayschannels.matrix.replyToModecontrols reply-to metadata when not replying in a thread:-
off(standart),first,all
11. Imkoniyatlar¶
| 12. Funksiya | 13. Holat |
|---|---|
| 14. Shaxsiy xabarlar | 15. ✅ Qo‘llab-quvvatlanadi |
| Rooms | 17. ✅ Qo‘llab-quvvatlanadi |
| Threads | 19. ✅ Qo‘llab-quvvatlanadi |
| 20. Media | 21. ✅ Qo‘llab-quvvatlanadi |
| 22. E2EE | 23. ✅ Qo‘llab-quvvatlanadi (kripto modul talab qilinadi) |
| 24. Reaksiyalar | 25. ✅ Qo‘llab-quvvatlanadi (vositalar orqali yuborish/o‘qish) |
| 26. So‘rovnomalar | 27. ✅ Yuborish qo‘llab-quvvatlanadi; kiruvchi so‘rovnoma boshlanishlari matnga aylantiriladi (javoblar/yakunlar e’tiborga olinmaydi) |
| 28. Joylashuv | 29. ✅ Qo‘llab-quvvatlanadi (geo URI; balandlik e’tiborga olinmaydi) |
| 30. Mahalliy buyruqlar | ✅ Supported |
32. Nosozliklarni bartaraf etish¶
- Avval ushbu ketma-ketlikni ishga tushiring:
34. openclaw status
openclaw gateway status
openclaw logs --follow
openclaw doctor
openclaw channels status --probe
- So‘ng zarur bo‘lsa DM juftlash holatini tasdiqlang:
36. openclaw pairing list matrix
- Keng tarqalgan xatolar:
-
- Tizimga kirilgan, ammo xona xabarlari e’tiborsiz: xona
groupPolicyyoki xona allowlisti tomonidan bloklangan.
- Tizimga kirilgan, ammo xona xabarlari e’tiborsiz: xona
-
- DMlar e’tiborsiz:
channels.matrix.dm.policy="pairing"bo‘lganda jo‘natuvchi tasdiqlanishni kutmoqda.
- DMlar e’tiborsiz:
-
- Shifrlangan xonalar ishlamaydi: kripto qo‘llab-quvvatlashi yoki shifrlash sozlamalari mos kelmaydi.
For triage flow: /channels/troubleshooting.
42. Konfiguratsiya ma’lumotnomasi (Matrix)¶
Full configuration: Configuration
- Provayder parametrlari:
-
channels.matrix.enabled: kanal ishga tushishini yoqish/o‘chirish.
-
channels.matrix.homeserver: homeserver URL manzili.
-
channels.matrix.userId: Matrix foydalanuvchi IDsi (access token bilan ixtiyoriy).
-
channels.matrix.accessToken: access token.
-
channels.matrix.password: tizimga kirish paroli (token saqlanadi).
-
channels.matrix.deviceName: qurilma ko‘rinadigan nomi.
channels.matrix.encryption: enable E2EE (default: false).channels.matrix.initialSyncLimit: initial sync limit.channels.matrix.threadReplies:off | inbound | always(default: inbound).channels.matrix.textChunkLimit: outbound text chunk size (chars).channels.matrix.chunkMode:length(default) ornewlineto split on blank lines (paragraph boundaries) before length chunking.channels.matrix.dm.policy:pairing | allowlist | open | disabled(default: pairing).channels.matrix.dm.allowFrom: DM allowlist (full Matrix user IDs).openrequires"*". The wizard resolves names to IDs when possible.channels.matrix.groupPolicy:allowlist | open | disabled(default: allowlist).channels.matrix.groupAllowFrom: allowlisted senders for group messages (full Matrix user IDs).channels.matrix.allowlistOnly: force allowlist rules for DMs + rooms.channels.matrix.groups: group allowlist + per-room settings map.channels.matrix.rooms: legacy group allowlist/config.channels.matrix.replyToMode: reply-to mode for threads/tags.channels.matrix.mediaMaxMb: inbound/outbound media cap (MB).channels.matrix.autoJoin: invite handling (always | allowlist | off, default: always).channels.matrix.autoJoinAllowlist: allowed room IDs/aliases for auto-join.channels.matrix.actions: per-action tool gating (reactions/messages/pins/memberInfo/channelInfo).