openclaw - ✅(Solved) Fix [Feishu] Support separate mention requirement for topic threads vs normal group messages [2 pull requests, 2 comments, 3 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#76010Fetched 2026-05-03 04:43:23
View on GitHub
Comments
2
Participants
3
Timeline
12
Reactions
2
Timeline (top)
mentioned ×3subscribed ×3commented ×2cross-referenced ×2

Current behavior

Currently, requireMention is configured at the group level (channels.feishu.groups.<chat_id>.requireMention), which applies to both normal group messages and topic thread replies.

Root Cause

Current behavior

Currently, requireMention is configured at the group level (channels.feishu.groups.<chat_id>.requireMention), which applies to both normal group messages and topic thread replies.

Fix Action

Fixed

PR fix notes

PR #76020: feat(feishu): add topicRequireMention for topic thread mention control

Description (problem / solution / changelog)

Summary

  • Problem: requireMention in Feishu groups applies equally to normal group messages and topic thread replies, with no way to separate the two. Users who want to require @mention for new conversations but allow free replies inside started threads cannot do so.
  • Why it matters: In busy group chats, requiring @mention on every topic reply is noisy and breaks the natural conversation flow inside a thread.
  • What changed: Added optional topicRequireMention boolean at top-level, per-account, and per-group config levels. When a message has thread_id set (Feishu topic thread), topicRequireMention takes precedence over requireMention. Falls back to existing requireMention cascade when unset.
  • What did NOT change: DM behavior, topic session routing (groupSessionScope, topicSessionMode), replyInThread, broadcast dispatch, and all other group access-control logic are unchanged.

Change Type (select all)

  • Bug fix
  • Feature
  • Refactor required for the fix
  • Docs
  • Security hardening
  • Chore/infra

Scope (select all touched areas)

  • Gateway / orchestration
  • Skills / tool execution
  • Auth / tokens
  • Memory / storage
  • Integrations
  • API / contracts
  • UI / DX
  • CI/CD / infra

Linked Issue/PR

  • Closes #76010
  • This PR fixes a bug or regression

Root Cause (if applicable)

N/A — this is a new feature, not a bug fix.

Regression Test Plan (if applicable)

N/A — new feature, no regression to guard against. New test coverage added instead:

  • Coverage level:
    • Unit test ✓
    • Seam / integration test
    • End-to-end test
    • Existing coverage already sufficient
  • Target test or file: extensions/feishu/src/policy.test.ts, extensions/feishu/src/bot.test.ts, extensions/feishu/src/config-schema.test.ts
  • Scenario the test should lock in: topic thread messages bypass mention gate when topicRequireMention=false; non-topic messages are unaffected by topicRequireMention
  • Why this is the smallest reliable guardrail: policy resolution is pure and fully unit-testable; bot-level integration test covers the full dispatch path
  • Existing test that already covers this (if any): N/A
  • If no new test is added, why not: Tests were added (6 unit + 2 integration + 5 schema)

User-visible / Behavior Changes

New optional config keys:

  • channels.feishu.topicRequireMention — top-level override for topic thread messages
  • channels.feishu.groups.<chat_id>.topicRequireMention — per-group override

When unset, behavior is identical to today. No defaults changed.

Diagram (if applicable)

Before: [group message] -> requireMention check -> respond / drop

After: [group message, thread_id set] -> topicRequireMention (if set) -> respond / drop ↓ (fallback) [group message, no thread_id] -> requireMention check -> respond / drop

Security Impact (required)

  • New permissions/capabilities? No
  • Secrets/tokens handling changed? No
  • New/changed network calls? No
  • Command/tool execution surface changed? No
  • Data access scope changed? No

Repro + Verification

Environment

  • OS: Linux
  • Runtime/container: Node 22
  • Model/provider: any
  • Integration/channel: Feishu (websocket mode)
  • Relevant config (redacted):

{ channels: { feishu: { groupPolicy: "allowlist", groups: { "oc_xxx": { requireMention: true, topicRequireMention: false, }, }, }, }, }

Steps

  1. Configure group with requireMention: true, topicRequireMention: false
  2. Send a normal group message without @mention → bot should not respond
  3. Send a message inside a topic thread without @mention → bot should respond

Expected

  • Step 2: no response
  • Step 3: bot responds

Actual

  • Verified via unit and integration tests (712 passed)

Evidence

  • Failing test/log before + passing after — 6 new unit tests in policy.test.ts, 2 integration tests in bot.test.ts, 5 schema tests in config-schema.test.ts, all passing (712 total)

Human Verification (required)

  • Verified scenarios: policy resolution cascade (per-group beats top-level, topic beats non-topic, DM short-circuit), schema acceptance/rejection at all three levels, bot dispatch gate with and without thread_id
  • Edge cases checked: topicRequireMention absent → full backwards compat; DM with both knobs set → still false; wildcard group entry with topicRequireMention
  • What you did not verify: live Feishu WebSocket delivery (no test credentials available)

Review Conversations

  • I replied to or resolved every bot review conversation I addressed in this PR.
  • I left unresolved only the conversations that still need reviewer or maintainer judgment.

Compatibility / Migration

  • Backward compatible? Yes
  • Config/env changes? Yes — two new optional config keys (topicRequireMention at top-level and per-group); no breaking changes, no migration needed
  • Migration needed? No

Risks and Mitigations

  • Risk: operator sets topicRequireMention: false globally and accidentally opens the bot to all topic thread messages without realizing requireMention only guards the main chat now
    • Mitigation: documented clearly in docs/channels/feishu.md with an explicit example showing the combined use of both flags

Changed files

  • CHANGELOG.md (modified, +1/-0)
  • docs/channels/feishu.md (modified, +55/-28)
  • extensions/feishu/src/bot.test.ts (modified, +73/-0)
  • extensions/feishu/src/bot.ts (modified, +1/-0)
  • extensions/feishu/src/config-schema.test.ts (modified, +43/-0)
  • extensions/feishu/src/config-schema.ts (modified, +3/-0)
  • extensions/feishu/src/policy.test.ts (modified, +99/-0)
  • extensions/feishu/src/policy.ts (modified, +20/-2)

PR #76070: fix #76010: [Feishu] Support separate mention requirement for topic threads vs normal group messages

Description (problem / solution / changelog)

Summary

Fixes #76010

Issue

[Feishu] Support separate mention requirement for topic threads vs normal group messages

Solution

<!-- Describe the changes made -->

Testing

<!-- Describe how the fix was tested -->

Changed files

  • extensions/feishu/src/bot.ts (modified, +3/-0)
  • extensions/feishu/src/config-schema.ts (modified, +2/-0)
  • extensions/feishu/src/policy.test.ts (modified, +79/-0)
  • extensions/feishu/src/policy.ts (modified, +30/-5)

Code Example

{
  channels: {
    feishu: {
      groups: {
        "oc_xxx": {
          "requireMention": true,           // for normal messages
          "topicRequireMention": false      // for topic/thread replies
        }
      }
    }
  }
}

---

{
  channels: {
    feishu: {
      groups: {
        "oc_xxx": {
          "requireMention": true,           // for normal messages
          "topicRequireMention": false      // for topic/thread replies
        }
      }
    }
  }
}
RAW_BUFFERClick to expand / collapse

Summary

Current behavior

Currently, requireMention is configured at the group level (channels.feishu.groups.<chat_id>.requireMention), which applies to both normal group messages and topic thread replies.

Problem to solve

Use case

In a busy group chat:

  • Users must @bot to start an interaction in the main chat
  • Once a topic/thread is created, users can continue the conversation without @mentioning every time

Proposed solution

Desired behavior

Allow separate mention requirements for:

  • Normal group messages → require @mention (to avoid spamming the main chat)
  • Topic/thread replies → no @mention required (for continuous conversation within a topic)

Proposed configuration

{
  channels: {
    feishu: {
      groups: {
        "oc_xxx": {
          "requireMention": true,           // for normal messages
          "topicRequireMention": false      // for topic/thread replies
        }
      }
    }
  }
}

Alternatives considered

Proposed configuration

{
  channels: {
    feishu: {
      groups: {
        "oc_xxx": {
          "requireMention": true,           // for normal messages
          "topicRequireMention": false      // for topic/thread replies
        }
      }
    }
  }
}

Impact

affect feishu channel:websocket mode

Evidence/examples

No response

Additional information

No response

extent analysis

TL;DR

Introduce a new configuration option topicRequireMention to allow separate mention requirements for normal group messages and topic/thread replies.

Guidance

  • Update the configuration to include both requireMention and topicRequireMention options for each group, as shown in the proposed configuration.
  • Set requireMention to true for normal group messages to prevent spamming the main chat.
  • Set topicRequireMention to false for topic/thread replies to allow continuous conversation within a topic.
  • Verify that the new configuration is applied correctly by testing both normal group messages and topic/thread replies.

Example

{
  "channels": {
    "feishu": {
      "groups": {
        "oc_xxx": {
          "requireMention": true,
          "topicRequireMention": false
        }
      }
    }
  }
}

Notes

This solution assumes that the existing configuration parsing and application logic can be extended to support the new topicRequireMention option.

Recommendation

Apply workaround by introducing the new configuration option topicRequireMention to achieve separate mention requirements for normal group messages and topic/thread replies. This allows for more fine-grained control over mention requirements in busy group chats.

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