hermes - 💡(How to fix) Fix bug(feishu): DM reply messages routed to thread instead of main chat [1 pull requests]

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…

Root Cause

In gateway/platforms/feishu.py, the _process_inbound_message method extracts thread_id using:

thread_id = getattr(message, "thread_id", None) or getattr(message, "root_id", None) or None

For Feishu DM replies, the API sets root_id to the parent message ID. This root_id is used as a fallback for thread_id, which causes:

  1. The session key to change from dm:oc_xxx to dm:oc_xxx:om_xxx
  2. The response to be sent with reply_in_thread=True via im.v1.message.reply
  3. The response lands in the inline thread instead of the main chat

Feishu's "reply" feature (inline reply with root_id) is semantically different from a forum topic thread (thread_id). They should not be conflated.

Fix Action

Fixed

Code Example

thread_id = getattr(message, "thread_id", None) or getattr(message, "root_id", None) or None
RAW_BUFFERClick to expand / collapse

Bug Description

When a user replies to a specific message in a Feishu DM (using the native "reply" feature), the bot's response is sent as a thread reply instead of appearing in the main chat. The user sees the typing indicator in the main chat but never receives the actual response.

Steps to Reproduce

  1. Send a message to the bot in a Feishu DM
  2. Wait for the bot to respond
  3. Long-press the bot's response and tap "Reply" (回复)
  4. Type a message and send it

Expected Behavior

The bot responds in the main DM chat, just like a regular message.

Actual Behavior

  • The typing indicator (emoji reaction) appears in the main chat ✅
  • The actual response is posted as a thread reply to the message being replied to — invisible in the main chat ❌

Root Cause

In gateway/platforms/feishu.py, the _process_inbound_message method extracts thread_id using:

thread_id = getattr(message, "thread_id", None) or getattr(message, "root_id", None) or None

For Feishu DM replies, the API sets root_id to the parent message ID. This root_id is used as a fallback for thread_id, which causes:

  1. The session key to change from dm:oc_xxx to dm:oc_xxx:om_xxx
  2. The response to be sent with reply_in_thread=True via im.v1.message.reply
  3. The response lands in the inline thread instead of the main chat

Feishu's "reply" feature (inline reply with root_id) is semantically different from a forum topic thread (thread_id). They should not be conflated.

Environment

  • Hermes Agent version: latest (main branch)
  • Feishu connection mode: websocket
  • Chat type: DM (p2p)

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