Files
hermes-agent/tests
Teknium 65214ceeac fix(matrix): trust m.mentions.user_ids as authoritative mention signal
Port from openclaw/openclaw#64796: Per MSC3952 / Matrix v1.7, the
m.mentions.user_ids field is the authoritative mention signal.  Non-
OpenClaw Matrix clients (Element, matrix-bot-sdk bots, etc.) commonly
send messages with proper m.mentions.user_ids metadata but without
duplicating the @bot text in the message body.

Before this change, _is_bot_mentioned() relied entirely on text-based
detection (body string matching and HTML pill detection), causing
messages from these clients to be silently dropped when
MATRIX_REQUIRE_MENTION=true.

Now, if the bot's user_id appears in m.mentions.user_ids, that alone
is sufficient to register a mention — matching the Matrix spec.
Text-based fallback remains for backwards compatibility with older
clients that don't populate m.mentions.
2026-04-12 17:07:28 -07:00
..