-
-
Notifications
You must be signed in to change notification settings - Fork 52.6k
Description
Issue: Bot replies create new topics instead of replying under the original topic in Feishu topic groups
Description
In Feishu/Lark topic groups (话题群), when a user mentions the bot within an existing topic thread, the bot's reply creates a new standalone topic instead of appearing as a comment under the original topic.
Steps to Reproduce
- Add the bot to a Feishu topic group (话题群)
- Create a new topic or navigate to an existing topic
- @mention the bot within that topic thread
- Observe that the bot's response appears as a new topic, not under the original topic
Expected Behavior
The bot's reply should appear as a comment under the original topic where it was mentioned.
Actual Behavior
The bot creates a new topic with its reply, causing the conversation to be fragmented.
Root Cause Analysis
In extensions/feishu/src/bot.ts, the bot uses ctx.messageId as the replyToMessageId when creating reply dispatchers. However, in topic groups:
- Messages have a
root_idfield identifying the topic's root message - The Feishu API requires targeting the root message ID to reply within a topic
- Using the specific message ID triggers the creation of a new topic
Proposed Solution
Change the reply target from ctx.messageId to ctx.rootId ?? ctx.messageId in both reply dispatcher calls:
- Line ~850: Permission error notification dispatcher
- Line ~935: Normal reply dispatcher
This ensures replies target the topic root when in a topic, falling back to normal behavior otherwise.
Environment
- OpenClaw version: 2026.2.17
- Feishu extension: @openclaw/feishu
Additional Context
Topic groups are a special group type in Feishu where conversations are organized as threads (topics) rather than a linear message stream. Proper handling of root_id is essential for correct reply behavior in this context.