Skip to content

[Bug]: Matrix: per-room requireMention/autoReply config ignored due to room ID case mismatch #19278

@wm408

Description

@wm408

Summary

Per-room group config settings (requireMention: false, autoReply: true) are silently ignored for Matrix rooms. The root cause is a case mismatch: room IDs are lowercased during config resolution at startup, but the message handler receives original-case room IDs from Matrix events and performs exact-case lookups. The config entry is never found, so the handler falls back to requireMention: true.

Steps to reproduce

  1. Configure a Matrix room with requireMention: false in openclaw.json:
"channels": {
  "matrix": {
    "groupPolicy": "open",
    "groups": {
      "!ArAQdbw5b42R5uBHuWz84xs6GI-Lf_4khGLMHPyTNzp": {
        "allow": true,
        "requireMention": false
      }
    }
  }
}
  1. Restart the gateway
  2. Send a message in that room without mentioning the bot
  3. Observe the gateway logs

Expected behavior

The bot should process all messages in the room without requiring a mention, since requireMention: false is set for that room.

Actual behavior

matrix rooms resolved: !ArAQdbw5b42R5uBHuWz84xs6GI-Lf_4khGLMHPyTNzp→!araqdbw5b42r5ubhuwz84xs6gi-lf_4khglmhpytnzp
...
matrix-auto-reply skipping room message  { roomId: "...", reason: "no-mention" }

The resolution step lowercases the room ID key in the internal roomsConfig map, but the handler's resolveMatrixRoomConfig() builds lookup candidates using the original-case room ID from the Matrix event. The exact-match lookup in resolveChannelEntryMatch() (Object.prototype.hasOwnProperty.call(entries, key)) fails because !ArAGdbw5... ≠ !aragdbw5...

OpenClaw version

2026.2.15

Operating system

Debian 1:6.12.62-1+rpt1 (2025-12-18) aarch64

Install method

curl -fsSL https://openclaw.ai/install.sh | bash

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingstaleMarked as stale due to inactivity

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions