Files
openclaw/docs/channels
Markus Hartung 4970ed2357 fix(matrix): accept Room v12 IDs without server suffix (#123931)
* fix(matrix): recognize room version 12 room IDs (no :server suffix)

Room version 12 (MSC4291) dropped the trailing ":server" from room
IDs -- they are now a hash of the create event. Every place in the
Matrix plugin that treated "!" + ":" as the signature of an
already-resolved room ID silently discarded valid v12 room IDs as
unresolved instead of using them directly:

- channels.matrix.rooms config resolution (config.ts) dropped the
  entry entirely, so group rooms could never pass the groupPolicy
  "allowlist" gate on a v12 homeserver -- messages were dropped with
  no reply and no default-level log line, since the only trace is a
  verbose-only debug log.
- The invite auto-join allowlist validator and the interactive
  group-room setup resolver in onboarding.ts had the same check
  duplicated, so a user typing a v12 room ID during setup would be
  told it was invalid.
- session-route.ts's per-room DM recipientSessionExact check had the
  same gap for room-kind sends.

Runtime auto-join (auto-join.ts) already only checked for the "!"
sigil, which is why joining a v12 room worked while responding in it
did not -- this made the bug hard to spot from the join path alone.

Fix: add a single canonical isMatrixRoomId predicate next to the
existing isMatrixQualifiedUserId in target-ids.ts (user IDs and
aliases still require ":server" per spec; only room IDs changed) and
reuse it at all four sites instead of repeating the stale check.

Confirmed live against a real Room v12 homeserver (Conduit): the
server's own /joined_rooms response returns bare "!<hash>" room IDs
with no colon.

* docs(matrix): document suffixless room version 12 room IDs

Room version 12 (MSC4291) dropped the ":server" suffix from room
IDs. Document that the suffixless "!room" form is accepted anywhere
the docs previously only showed "!room:server", matching the
target-ids.ts fix landed in this same PR.

* fix(matrix): update stale Room v12 guidance text

* docs(matrix): accept suffixless Room v12 IDs in the group-policy guide

docs/channels/matrix.md already documents that channels.matrix.groups
accepts the suffixless !room form on room version 12+, but the
group-policy guide (docs/channels/groups.md) still only listed
!room:server, contradicting the channel doc an operator on a v12
homeserver would actually be following.

Addresses the ClawSweeper P2 finding on PR #123931.

* fix(matrix): advertise suffixless Room v12 IDs in onboarding placeholders

The invite auto-join and group-room setup prompts' placeholder text
still showed only `!roomId:server`, even though the retry note,
validation, and unresolved-room diagnostic already accept and describe
the suffixless `!roomId` form on room version 12+. An operator on a
v12 homeserver would see their homeserver's own room IDs contradicted
by the very placeholder guiding them through setup.

Updated both placeholders to list the suffixless form alongside the
existing examples, matching the phrasing already used in
docs/channels/matrix.md and the invite retry note. Added
configureRoomsAccess/roomsAllowlist options to the shared
createMatrixUpdateKeepCredentialsPrompter test harness (mirroring the
existing inviteAutoJoin option) so the group-room setup flow can be
exercised without duplicating the base prompter setup, then added
focused tests asserting the exact placeholder text for both prompts.
Verified both new tests fail against the pre-fix placeholders and pass
after.

Addresses the two ClawSweeper P2 findings on PR #123931.

* test(matrix): restore only allowlisted environment keys

* fix(matrix): reject empty room identifiers

---------

Co-authored-by: Patrick Erichsen <patrick.a.erichsen@gmail.com>
2026-08-19 16:12:05 -07:00
..