From 4145f3eaccc6bdc992c8fe46f086d12bcb807b4f Mon Sep 17 00:00:00 2001 From: kohath Date: Fri, 20 Mar 2026 22:26:27 +0800 Subject: [PATCH] feat(feishu): add thread reply support for topic group messages --- nanobot/channels/feishu.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/nanobot/channels/feishu.py b/nanobot/channels/feishu.py index 5e3d126..06daf40 100644 --- a/nanobot/channels/feishu.py +++ b/nanobot/channels/feishu.py @@ -960,6 +960,9 @@ class FeishuChannel(BaseChannel): and not msg.metadata.get("_progress", False) ): reply_message_id = msg.metadata.get("message_id") or None + # For topic group messages, always reply to keep context in thread + elif msg.metadata.get("thread_id"): + reply_message_id = msg.metadata.get("root_id") or msg.metadata.get("message_id") or None first_send = True # tracks whether the reply has already been used @@ -1121,6 +1124,7 @@ class FeishuChannel(BaseChannel): # Extract reply context (parent/root message IDs) parent_id = getattr(message, "parent_id", None) or None root_id = getattr(message, "root_id", None) or None + thread_id = getattr(message, "thread_id", None) or None # Prepend quoted message text when the user replied to another message if parent_id and self._client: @@ -1149,6 +1153,7 @@ class FeishuChannel(BaseChannel): "msg_type": msg_type, "parent_id": parent_id, "root_id": root_id, + "thread_id": thread_id, } )