Conversation
fixes Tencent#222) Squashed from two commits: - 3359efd fix: pass ref_msg content as structured ReplyTo fields for inbound_meta - 5d9361a fix: use quoted message_id for ReplyToId, exclude title from ReplyToBody Three fixes: 1. ReplyToId uses quoted message_id (not item's own ID) 2. ReplyToBody excludes title (title goes to ReplyToSender independently) 3. Media refs (IMAGE/VIDEO/FILE/VOICE) skip ReplyToBody Refactored extractRefBody() and findRefMsg() to eliminate duplication. Added 5 boundary tests for ReplyTo fields. Reviewed-by: Dennis (tech), Bishop (QA)
5d9361a to
c412e60
Compare
|
The current community-maintained https://github.com/NewFuture/openclaw-weixin Currently released behavior preserves quoted text in the message body using the For users who only need the existing body-level quote support, the community package can be installed/replaced in place (requires OpenClaw openclaw plugins install npm:openclaw-weixin --forceThe plugin/channel ID and state paths are unchanged, so this normally preserves existing configuration and login state. For clarity: the linked repository/package is a community-maintained distribution, not the official Tencent/Weixin release. This upstream Tencent PR is still open, and this comment does not claim that its structured metadata change has been merged. |
Summary
When a user sends a message that quotes another message (ref_msg), the plugin previously only prepended the quoted content as
[引用: ...]prefix in the Body text. This meant the quoted content did not appear in the framework's structuredinbound_meta(untrusted reply target block) thatbuildInboundUserContextPrefix()generates fromReplyToBody/ReplyToIdfields.Root Cause
The
weixinMessageToMsgContext()function extractedref_msgcontent solely into the Body text prefix. The OpenClaw core framework usesMsgContextfields likeReplyToBody,ReplyToId,ReplyToSender,ReplyToIsQuoteto include the quoted message as a structured "Reply target of current user message (untrusted, for context)" block in the agent'sinbound_meta. These fields were never populated by the weixin plugin.Changes
ReplyToBody,ReplyToId,ReplyToSender,ReplyToIsQuotefields toWeixinMsgContexttyperef_msgcontent and populate these fields inweixinMessageToMsgContext()so the framework includes the quoted message in the untrusted reply target metadata blockextractRefBody()helper frombodyFromItemList()to eliminate duplicated ref_msg content extraction logicVerification
npm run build— cleannpm test— 396/397 pass (1 pre-existing Windows path separator issue instate-dir.test.ts)src/messaging/inbound.test.ts) — all 25 passtsc --noEmit— cleanCloses #222