Skip to content

[Bug]: bot replies outside thread in P2P direct message thread #38806

@LiaoyuanNing

Description

@LiaoyuanNing

Bug type

Behavior bug (incorrect output/state without crash)

Summary

When a user sends a message inside a Feishu thread in a P2P (direct message) chat, the bot's reply is sent outside the thread as a standalone message, instead of replying within the thread.

This regression was introduced by #33789, which fixed group reply targeting (#32980) but inadvertently broke P2P thread replies by gating all thread-aware logic behind isGroup checks.

Steps to reproduce

  1. Open a P2P (single) chat with the bot in Feishu
  2. Create a thread on any message
  3. Send a message inside the thread
  4. Observe: bot replies outside the thread as a new message in the main chat

Expected behavior

Bot should reply inside the thread, keeping the conversation within the thread context.

Actual behavior

Three places in extensions/feishu/src/bot.ts hardcode P2P to skip thread-aware reply logic:

  1. replyInThread forced to false for P2P — Feishu API never receives reply_in_thread: true
  2. replyTargetMessageId ignores root_id for P2P — reply targets the triggering message instead of the thread root
  3. skipReplyToInMessages: !isGroup — P2P always skips reply-to, so the send layer uses im.message.create (new message) instead of im.message.reply (thread reply)

Per the Feishu API docs, thread_id indicates a thread message while root_id alone indicates a quote reply. The fix uses this
distinction to handle P2P threads correctly without affecting group behavior.

OpenClaw version

2026.3.3

Operating system

macOS 15.4

Install method

No response

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingbug:behaviorIncorrect behavior without a crash

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions