From 28299afc21a37784d93b90924317f004ea2298af Mon Sep 17 00:00:00 2001 From: kshitijk4poor <82637225+kshitijk4poor@users.noreply.github.com> Date: Wed, 6 May 2026 23:13:05 +0530 Subject: [PATCH] chore: follow-up cleanup for Feishu topic thread fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Remove dead metadata.get('reply_to') fallback in _send_raw_message; nothing in the codebase ever sets 'reply_to' inside a metadata dict — the key only appears as a top-level send_voice() keyword argument - Simplify _status_thread_metadata construction in run.py to use a single dict literal instead of create-then-mutate pattern; the or-{} guard was dead since source.thread_id implies _progress_thread_id is also set for Feishu - Add yuqian@zmetasoft.com to AUTHOR_MAP for contributor attribution --- gateway/platforms/feishu.py | 2 +- gateway/run.py | 9 ++++++--- scripts/release.py | 1 + 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/gateway/platforms/feishu.py b/gateway/platforms/feishu.py index 2c2b6f8750..e1c1a731c6 100644 --- a/gateway/platforms/feishu.py +++ b/gateway/platforms/feishu.py @@ -4091,7 +4091,7 @@ class FeishuAdapter(BasePlatformAdapter): ) -> Any: effective_reply_to = reply_to if not effective_reply_to and metadata and metadata.get("thread_id"): - effective_reply_to = metadata.get("reply_to_message_id") or metadata.get("reply_to") + effective_reply_to = metadata.get("reply_to_message_id") reply_in_thread = bool((metadata or {}).get("thread_id")) if effective_reply_to: body = self._build_reply_message_body( diff --git a/gateway/run.py b/gateway/run.py index ff512205b8..1c125d9aff 100644 --- a/gateway/run.py +++ b/gateway/run.py @@ -13178,14 +13178,17 @@ class GatewayRunner: # Bridge sync status_callback → async adapter.send for context pressure _status_adapter = self.adapters.get(source.platform) _status_chat_id = source.chat_id - _status_thread_metadata = {"thread_id": _progress_thread_id} if _progress_thread_id else None if source.platform == Platform.FEISHU and source.thread_id and event_message_id: # Feishu topics only keep messages inside the topic when they are # sent via the reply API with reply_in_thread=true. Status/interim, # approval, and stream-consumer paths usually only receive metadata, # so carry the triggering message id as a Feishu-specific fallback. - _status_thread_metadata = dict(_status_thread_metadata or {}) - _status_thread_metadata["reply_to_message_id"] = event_message_id + _status_thread_metadata: Optional[Dict[str, Any]] = { + "thread_id": _progress_thread_id, + "reply_to_message_id": event_message_id, + } + else: + _status_thread_metadata = {"thread_id": _progress_thread_id} if _progress_thread_id else None def _status_callback_sync(event_type: str, message: str) -> None: if not _status_adapter or not _run_still_current(): diff --git a/scripts/release.py b/scripts/release.py index 905621cfc7..09ac83ca76 100755 --- a/scripts/release.py +++ b/scripts/release.py @@ -771,6 +771,7 @@ AUTHOR_MAP = { "steven_chanin@alum.mit.edu": "stevenchanin", "fiver@example.com": "halmisen", "mayq0422@gmail.com": "yuqianma", + "yuqian@zmetasoft.com": "yuqianma", "scott@bubble.local": "bassings", "highland0971@users.noreply.github.com": "highland0971", "sudolewis@gmail.com": "lewislulu",