AI & Integration v1.1.1

matrix-mentions-patch

Fix OpenClaw Matrix plugin mention detection bug. Use when OpenClaw doesn't respond to @mentions in Matrix group rooms...

biociao 更新于 2026-05-16 1 浏览
下载 SKILL

技能说明

Fix OpenClaw Matrix plugin mention detection bug. Use when OpenClaw doesn't respond to @mentions in Matrix group rooms despite correct configuration. The bug is that buildMentionRegexes() is called without agentId, causing mention patterns to not be built correctly.

使用场景

Fix OpenClaw Matrix plugin mention detection bug. Use when OpenClaw doesn't respond to @mentions in Matrix group rooms despite correct configuration. The bug is that buildMentionRegexes() is called without agentId, causing mention patterns to not be built correctly.

直接复制以下提示词,发送给你的 AI 助手即可完成安装。

帮我下载并安装这个SKILL:https://skillhub.cstcloud.cn/download/matrix-mentions-patch
  1. 点击上方「下载 SKILL」按钮,获取技能压缩包。
  2. 将压缩包解压到你的 Agent 技能目录。
  3. 重启客户端后即可在技能列表中选择该技能。

技能文件内容

4 个文件 · 17 kB
SKILL.md text/markdown
---
name: matrix-mentions-patch
description: Fix OpenClaw Matrix plugin mention detection bug. Use when OpenClaw doesn't respond to @mentions in Matrix group rooms despite correct configuration. The bug is that buildMentionRegexes() is called without agentId, causing mention patterns to not be built correctly.
---

# Matrix Mentions Patch

## Problem

OpenClaw Matrix plugin doesn't respond to @mentions in group rooms even when:
- The room is configured with `requireMention: true`
- The user correctly @mentions the bot (e.g., `@runwheezy:matrix.biochao.cc`)

## Root Cause

In `/home/bot/.openclaw/extensions/matrix/src/matrix/monitor/index.ts`, the `buildMentionRegexes` function is called WITHOUT passing `agentId`:

```typescript
// BUG: Missing agentId parameter
const mentionRegexes = core.channel.mentions.buildMentionRegexes(cfg);
```

Without `agentId`, the function can't resolve agent-specific mention patterns from config, causing mentions to never be detected.

## Fix

Edit `/home/bot/.openclaw/extensions/matrix/src/matrix/monitor/index.ts`:

Find line ~298:
```typescript
const mentionRegexes = core.channel.mentions.buildMentionRegexes(cfg);
```

Change to:
```typescript
const mentionRegexes = core.channel.mentions.buildMentionRegexes(cfg, "main");
```

Replace "main" with your actual agent ID if different.

## Apply

1. Make the edit above
2. Restart OpenClaw gateway: `openclaw gateway restart`

The fix loads immediately - no rebuild needed since the extension is loaded dynamically.

文件内容直接读取自技能仓库,仅供安装前审阅;以实际下载的压缩包为准。