Files
openclaw/extensions
nightq f371453ec2 fix(matrix): strip mention prefix before slash command matching
Fixes openclaw#68547

Root cause: When a user sends a message like `@bot:server /new` in a Matrix room,
the slash command was not recognized because the mention prefix was not stripped
before checking for slash commands via hasControlCommand().

Fix: Added stripMatrixMentionPrefixes() function that strips bot mention prefixes
from the beginning of messages before passing text to hasControlCommand(). This
follows the same pattern used by Feishu (normalizeMentions) and ensures that
slash commands work correctly when the bot is explicitly mentioned.

- Added stripMatrixMentionPrefixes() helper function in handler.ts
- Applied stripping before hasControlCommand() call
- Added comprehensive test coverage in handler.strip-mention.test.ts
2026-04-19 16:48:43 -04:00
..