From 4bab3a3483170cd909cd51ecf3b06406a7a7969e Mon Sep 17 00:00:00 2001 From: WeDone Date: Tue, 12 May 2026 12:16:14 +0800 Subject: [PATCH] =?UTF-8?q?fix(zulip):=20=E7=94=A8=20=5Frecipient=5Fmap=20?= =?UTF-8?q?=E8=A1=A5=E5=85=A8=E7=BC=BA=E5=A4=B1=E7=9A=84=E8=B7=AF=E7=94=B1?= =?UTF-8?q?=E5=85=83=E6=95=B0=E6=8D=AE=EF=BC=8C=E4=BF=AE=E5=A4=8D=E9=99=84?= =?UTF-8?q?=E4=BB=B6=E5=8F=91=E9=80=81=E6=8A=A5=E9=94=99=20Message=20must?= =?UTF-8?q?=20have=20recipients?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit MessageTool 创建的 OutboundMessage 只包含 message_id,缺少 msg_type/stream/topic/recipient_user_id 等 Zulip 路由字段,导致 _build_send_request 生成空收件人列表。 _recipient_map 在收到消息时已存储了完整的路由元数据,但从未被用于补全发送消息的元数据。 修复:在 send() 中,当 metadata 缺少 msg_type 时,从 _recipient_map 查找对应 chat_id 的路由信息并合并,确保发送消息时始终有正确的收件人。 --- deeptutor/tutorbot/channels/zulip.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/deeptutor/tutorbot/channels/zulip.py b/deeptutor/tutorbot/channels/zulip.py index f81a3a0f7..bed775ca0 100644 --- a/deeptutor/tutorbot/channels/zulip.py +++ b/deeptutor/tutorbot/channels/zulip.py @@ -157,6 +157,11 @@ class ZulipChannel(BaseChannel): logger.warning("Zulip client not running") return + if not msg.metadata.get("msg_type"): + stored = self._recipient_map.get(msg.chat_id) + if stored: + msg.metadata = {**stored, **msg.metadata} + if not msg.metadata.get("_progress", False): self._stop_typing(msg.chat_id)