From e9176de1f8577b318842f4f9bf1417d4af9b5b0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8F=B2=E5=90=AF=E6=98=8E=EF=BC=88QimingShi=EF=BC=89?= Date: Sun, 10 May 2026 11:44:40 +0800 Subject: [PATCH 1/2] fix(feishu): handle quote field for quoted replies Feishu adapter was ignoring the quote field when users reply with a native quote (selecting part of a previous message). This caused reply_to_message_id and reply_to_text to be empty, losing reply context. Now extracts quote.id / quote.message_id and quote.text from the Feishu message, using them as fallback when parent_id / upper_message_id are not present. Mirrors the Signal adapter pattern. Fixes #22934 --- gateway/platforms/feishu.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/gateway/platforms/feishu.py b/gateway/platforms/feishu.py index 0470aaa266569..2526afea36fc0 100644 --- a/gateway/platforms/feishu.py +++ b/gateway/platforms/feishu.py @@ -2931,13 +2931,27 @@ async def _process_inbound_message( text = f"{hint}\n\n{text}" if text else hint thread_id = getattr(message, "thread_id", None) or getattr(message, "root_id", None) or None + + # Extract quote (reply-to) context from Feishu message. + # Feishu populates the quote field when a user replies with a + # native quote (selecting part of a previous message). + quote = getattr(message, "quote", None) + if quote is not None: + quote_id = getattr(quote, "id", None) or getattr(quote, "message_id", None) + quote_text = getattr(quote, "text", None) + else: + quote_id = None + quote_text = None + reply_to_message_id = ( getattr(message, "parent_id", None) or getattr(message, "upper_message_id", None) or getattr(message, "root_id", None) + or quote_id or None ) reply_to_text = await self._fetch_message_text(reply_to_message_id) if reply_to_message_id else None + reply_to_text = reply_to_text or quote_text sender_primary = ( getattr(sender_id, "open_id", None) From 042e73edd7d4961f72cb48d654d796254777cd71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8F=B2=E5=90=AF=E6=98=8E=EF=BC=88QimingShi=EF=BC=89?= Date: Sun, 10 May 2026 13:30:33 +0800 Subject: [PATCH 2/2] fix(feishu): handle quote field for quoted replies Rebased on latest main. Fixes #22969