openclaw - 💡(How to fix) Fix [Bug]: requireMention bypassed for ALL agents in Telegram Forum topics [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#77920Fetched 2026-05-06 06:19:25
View on GitHub
Comments
1
Participants
2
Timeline
8
Reactions
2
Timeline (top)
mentioned ×3subscribed ×3closed ×1commented ×1

In Telegram Forum groups with requireMention: true, ALL agents receive and process messages from forum topics — even those not @mentioned. The mention gating is completely bypassed for forum topic messages.

Root Cause

Root Cause Hypothesis

Code Example

{
  channels: {
    telegram: {
      groups: {
        "-1003544654550": {
          requireMention: true,
          topics: {}
        }
      }
    }
  },
  agents: {
    list: [
      { id: "deepseek", groupChat: { mentionPatterns: ["@深", "@阿深", "@XuanDeepSeekBot", "@所有人"] } },
      { id: "kimi",     groupChat: { mentionPatterns: ["@月", "@老月", "@所有人", "@XuanKimiBot"] } },
      { id: "minimax",  groupChat: { mentionPatterns: ["@小极", "@XuanMinimaxBot", "@所有人"] } },
      { id: "general",  groupChat: { mentionPatterns: ["@零", "@DaoXuan1Bot"] } },
      { id: "glm",      groupChat: { mentionPatterns: ["@愚者", "@所有人", "@DaoXuan2Bot"] } },
      { id: "qwen",     groupChat: { mentionPatterns: ["@千问", "@问哥", "@Xuandao_bot", "@所有人"] } }
    ]
  }
}

---

telegram:-1003544654550:topic:7082

---

-1003544654550
RAW_BUFFERClick to expand / collapse

Summary

In Telegram Forum groups with requireMention: true, ALL agents receive and process messages from forum topics — even those not @mentioned. The mention gating is completely bypassed for forum topic messages.

Environment

  • OpenClaw version: 2026.4.27
  • OS: Windows 10.0.26200
  • Node: v24.13.1
  • Channel: Telegram (6 bot accounts in the same forum group)
  • Group: -1003544654550 (forum/supergroup, is_forum: true)

Config

{
  channels: {
    telegram: {
      groups: {
        "-1003544654550": {
          requireMention: true,
          topics: {}
        }
      }
    }
  },
  agents: {
    list: [
      { id: "deepseek", groupChat: { mentionPatterns: ["@深", "@阿深", "@XuanDeepSeekBot", "@所有人"] } },
      { id: "kimi",     groupChat: { mentionPatterns: ["@月", "@老月", "@所有人", "@XuanKimiBot"] } },
      { id: "minimax",  groupChat: { mentionPatterns: ["@小极", "@XuanMinimaxBot", "@所有人"] } },
      { id: "general",  groupChat: { mentionPatterns: ["@零", "@DaoXuan1Bot"] } },
      { id: "glm",      groupChat: { mentionPatterns: ["@愚者", "@所有人", "@DaoXuan2Bot"] } },
      { id: "qwen",     groupChat: { mentionPatterns: ["@千问", "@问哥", "@Xuandao_bot", "@所有人"] } }
    ]
  }
}

Steps to Reproduce

  1. Configure a Telegram Forum group (is_forum: true) with requireMention: true
  2. Add multiple bot accounts to the group
  3. Send a message in a forum topic that @mentions only ONE specific bot
    • e.g., @XuanDeepSeekBot 辩题:爱欲已死 vs 爱欲未死
  4. Check session files under ~/.openclaw/agents/*/sessions/ for ALL agents

Expected Behavior

Only the @mentioned agent (deepseek) should receive and process the message. The other 5 agents should drop it at the Gateway level with reason "no mention".

Actual Behavior

All 6 agents received and processed the message. Session file evidence from agents/*/sessions/*-topic-7082.jsonl:

AgentModelReceived (UTC)Processed?Sent messages to group?
generaldeepseek-v4-flash13:25:51Yes (xuan-debate skill, spawned subagents)No
kimideepseek-v4-pro13:25:52Yes (xuan-debate skill, spawned subagents)No
minimaxMiniMax-M2.713:25:54Yes (xuan-debate skill, thinking only)No
qwendeepseek-v4-pro13:29:20Yes (xuan-debate skill)⚠️ Yes — sent 5 debate result messages to the group
glmdeepseek-v4-pro13:30:55Yes (xuan-debate skill, spawned subagents)No
deepseekdeepseek-v4-pro~13:25Yes (spawned as subagent by kimi)Yes (subagent)

Key evidence:

  • The message was @XuanDeepSeekBot — only deepseek's mentionPatterns include @XuanDeepSeekBot
  • Yet kimi, minimax, general, glm, and qwen all received and processed it
  • qwen alone sent 5 unwanted debate result messages to the group chat
  • All 6 session files contain the identical incoming message text

Root Cause Hypothesis

The session files show chat_id as:

telegram:-1003544654550:topic:7082

But the group config key is:

-1003544654550

The :topic:7082 suffix likely causes the group ID lookup in resolveChannelGroupRequireMention to fail to match against the bare group ID in channels.telegram.groups, causing requireMention to default to false. This bypasses the entire mention gating for ALL forum topic messages.

Impact

  • Security: Any message in a forum topic with requireMention: true reaches all agents, bypassing access controls
  • Cost/Noise: Non-mentioned agents process unwanted messages, spawning subagents (costing tokens) and potentially sending unwanted replies
  • User Experience: Users see bots responding when they weren't addressed

Related Issues

  • #32256 — Same root cause area (forum topic implicitMention detection broken)
  • #19883 — Related forum topic mention detection issues

extent analysis

TL;DR

Update the group config to include the :topic: suffix in the group ID to match the chat_id format used in session files.

Guidance

  • Verify that the chat_id in session files matches the format used in the group config by checking the :topic: suffix.
  • Update the group config to include the :topic: suffix in the group ID, for example: "telegram:-1003544654550:topic:7082".
  • Test the updated config by sending a message in a forum topic and checking that only the mentioned agent receives and processes the message.
  • Review related issues #32256 and #19883 for potential additional fixes or workarounds.

Example

{
  channels: {
    telegram: {
      groups: {
        "telegram:-1003544654550:topic:7082": {
          requireMention: true,
          topics: {}
        }
      }
    }
  }
}

Notes

The provided root cause hypothesis suggests that the issue is due to a mismatch between the chat_id format in session files and the group ID in the config. Updating the config to include the :topic: suffix should resolve the issue. However, additional testing and review of related issues may be necessary to ensure a complete fix.

Recommendation

Apply the workaround by updating the group config to include the :topic: suffix in the group ID, as this is the most direct and likely solution based on the provided information.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix [Bug]: requireMention bypassed for ALL agents in Telegram Forum topics [1 comments, 2 participants]