Skip to content

fix(feishu): stop using root_id as thread_id for DM replies - #29467

Closed
nasymonk wants to merge 1 commit into
NousResearch:mainfrom
nasymonk:fix/feishu-dm-reply-threading
Closed

fix(feishu): stop using root_id as thread_id for DM replies#29467
nasymonk wants to merge 1 commit into
NousResearch:mainfrom
nasymonk:fix/feishu-dm-reply-threading

Conversation

@nasymonk

Copy link
Copy Markdown

Summary

  • Stop using Feishu root_id as a fallback thread_id for inbound messages
  • Feishu sets root_id on ordinary inline DM replies (not just forum topics), which causes reply messages to be routed to a separate thread-keyed session
  • Keep root_id available as reply context via reply_to_message_id (unchanged)

Problem

When a user replies to a specific message in a Feishu DM, the bot's typing indicator appears in the main chat, but the actual response is posted as a thread reply — invisible in the main chat window.

Root cause: thread_id falls back to root_id, and Feishu sets root_id for all inline replies. This changes the session key from dm:oc_xxx to dm:oc_xxx:om_xxx, causing the response to be sent with reply_in_thread=True.

Fix

Only use the explicit thread_id attribute (Feishu forum topics) for session routing. Remove root_id from the thread_id fallback chain.

Fixes #29466

Feishu sets root_id on ordinary inline DM replies, which should stay
in the main chat session rather than spawning a new thread-keyed session.

Only use the explicit thread_id attribute (forum topics) for session
routing. root_id is still preserved as reply context via
reply_to_message_id.

Fixes #29466
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists platform/feishu Feishu / Lark adapter comp/gateway Gateway runner, session dispatch, delivery labels May 20, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Duplicate of #20562 — same fix (remove root_id from thread_id fallback chain). See also closed #23282 which landed the same change.

@nasymonk nasymonk closed this by deleting the head repository Jul 10, 2026
GodJones pushed a commit to GodJones/hermes-agent that referenced this pull request Aug 8, 2026
Feishu sets root_id on ordinary inline replies, which must stay in the
main chat session. Using it as thread_id spawned a new thread-keyed
session and bound replies to the quoted message.

Refs: NousResearch#29466 (open), PR NousResearch#29467 (closed, unmerged). Local-only fix on a
branch so it survives updates via rebase origin/main.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/gateway Gateway runner, session dispatch, delivery P2 Medium — degraded but workaround exists platform/feishu Feishu / Lark adapter type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(feishu): DM reply messages routed to thread instead of main chat

2 participants