diff --git a/.openclaw-sync/source.json b/.openclaw-sync/source.json index aa1d69ad6..3796a72b1 100644 --- a/.openclaw-sync/source.json +++ b/.openclaw-sync/source.json @@ -1,5 +1,5 @@ { "repository": "openclaw/openclaw", - "sha": "0ef9383487a222020c20d51550eadcbb26882132", - "syncedAt": "2026-04-05T18:27:22.006Z" + "sha": "dcd0cf9f98a5236f89e19072f451ad3b77f4e64b", + "syncedAt": "2026-04-05T19:16:26.646Z" } diff --git a/docs/channels/matrix.md b/docs/channels/matrix.md index 543cff92b..d58c713f4 100644 --- a/docs/channels/matrix.md +++ b/docs/channels/matrix.md @@ -152,6 +152,7 @@ This is a practical baseline config with DM pairing, room allowlist, and E2EE en dm: { policy: "pairing", + sessionScope: "per-room", threadReplies: "off", }, @@ -522,12 +523,17 @@ The repair flow does not delete old rooms automatically. It only picks the healt Matrix supports native Matrix threads for both automatic replies and message-tool sends. +- `dm.sessionScope: "per-user"` (default) keeps Matrix DM routing sender-scoped, so multiple DM rooms can share one session when they resolve to the same peer. +- `dm.sessionScope: "per-room"` isolates each Matrix DM room into its own session key while still using normal DM auth and allowlist checks. +- Explicit Matrix conversation bindings still win over `dm.sessionScope`, so bound rooms and threads keep their chosen target session. - `threadReplies: "off"` keeps replies top-level and keeps inbound threaded messages on the parent session. - `threadReplies: "inbound"` replies inside a thread only when the inbound message was already in that thread. - `threadReplies: "always"` keeps room replies in a thread rooted at the triggering message and routes that conversation through the matching thread-scoped session from the first triggering message. - `dm.threadReplies` overrides the top-level setting for DMs only. For example, you can keep room threads isolated while keeping DMs flat. - Inbound threaded messages include the thread root message as extra agent context. - Message-tool sends now auto-inherit the current Matrix thread when the target is the same room, or the same DM user target, unless an explicit `threadId` is provided. +- Same-session DM user-target reuse only kicks in when the current session metadata proves the same DM peer on the same Matrix account; otherwise OpenClaw falls back to normal user-scoped routing. +- When OpenClaw sees a Matrix DM room collide with another DM room on the same shared Matrix DM session, it posts a one-time `m.notice` in that room with the `/focus` escape hatch when thread bindings are enabled and the `dm.sessionScope` hint. - Runtime thread bindings are supported for Matrix. `/focus`, `/unfocus`, `/agents`, `/session idle`, `/session max-age`, and thread-bound `/acp spawn` now work in Matrix rooms and DMs. - Top-level Matrix room/DM `/focus` creates a new Matrix thread and binds it to the target session when `threadBindings.spawnSubagentSessions=true`. - Running `/focus` or `/acp spawn --thread here` inside an existing Matrix thread binds that current thread instead. @@ -842,8 +848,9 @@ Live directory lookup uses the logged-in Matrix account: - `mediaMaxMb`: media size cap in MB for Matrix media handling. It applies to outbound sends and inbound media processing. - `autoJoin`: invite auto-join policy (`always`, `allowlist`, `off`). Default: `off`. - `autoJoinAllowlist`: rooms/aliases allowed when `autoJoin` is `allowlist`. Alias entries are resolved to room IDs during invite handling; OpenClaw does not trust alias state claimed by the invited room. -- `dm`: DM policy block (`enabled`, `policy`, `allowFrom`, `threadReplies`). +- `dm`: DM policy block (`enabled`, `policy`, `allowFrom`, `sessionScope`, `threadReplies`). - `dm.allowFrom` entries should be full Matrix user IDs unless you already resolved them through live directory lookup. +- `dm.sessionScope`: `per-user` (default) or `per-room`. Use `per-room` when you want each Matrix DM room to keep separate context even if the peer is the same. - `dm.threadReplies`: DM-only thread policy override (`off`, `inbound`, `always`). It overrides the top-level `threadReplies` setting for both reply placement and session isolation in DMs. - `execApprovals`: Matrix-native exec approval delivery (`enabled`, `approvers`, `target`, `agentFilter`, `sessionFilter`). - `execApprovals.approvers`: Matrix user IDs allowed to approve exec requests. Optional when `dm.allowFrom` already identifies the approvers. diff --git a/docs/gateway/configuration-reference.md b/docs/gateway/configuration-reference.md index 50ac90b17..63224be8c 100644 --- a/docs/gateway/configuration-reference.md +++ b/docs/gateway/configuration-reference.md @@ -655,6 +655,7 @@ Matrix is extension-backed and configured under `channels.matrix`. - `sessionFilter`: optional session key patterns (substring or regex). - `target`: where to send approval prompts. `"dm"` (default), `"channel"` (originating room), or `"both"`. - Per-account overrides: `channels.matrix.accounts..execApprovals`. +- `channels.matrix.dm.sessionScope` controls how Matrix DMs group into sessions: `per-user` (default) shares by routed peer, while `per-room` isolates each DM room. - Matrix status probes and live directory lookups use the same proxy policy as runtime traffic. - Full Matrix configuration, targeting rules, and setup examples are documented in [Matrix](/channels/matrix).