Skip to content

[feishu] Bot replies create new topics instead of replying under the original topic in topic groups #20742

@paceyw

Description

@paceyw

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

  1. Add the bot to a Feishu topic group (话题群)
  2. Create a new topic or navigate to an existing topic
  3. @mention the bot within that topic thread
  4. 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_id field 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    staleMarked as stale due to inactivity

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions