Skip to content

fix(messaging): suppress NO_REPLY silent token on WeChat outbound - #299

Open
vyrnsynx wants to merge 1 commit into
Tencent:mainfrom
vyrnsynx:fix/suppress-no-reply-token
Open

vyrnsynx wants to merge 1 commit into
Tencent:mainfrom
vyrnsynx:fix/suppress-no-reply-token

Conversation

@vyrnsynx

@vyrnsynx vyrnsynx commented Sep 8, 2026

Copy link
Copy Markdown

Summary

  • When a turn's final reply is the OpenClaw silent token NO_REPLY / no_reply, the WeChat outbound path was delivering the literal string as a real message (textLen=8).
  • Gate outbound text with the host isSilentReplyText helper (via a thin isSilentOutboundText wrapper) so exact silent tokens are skipped before sendMessage / deliver / channel outbound.
  • If media is present alongside a silent token, strip the token text and still deliver the media.

Fixes #293

Changes

File Change
src/messaging/silent-reply.ts Wrapper around SDK isSilentReplyText
src/messaging/send.ts Defense-in-depth skip in sendMessageWeixin
src/messaging/process-message.ts Skip/strip in reply deliver callback
src/channel.ts Skip/strip in sendWeixinOutbound / sendMedia
src/messaging/silent-reply.test.ts / send.test.ts Unit coverage for suppress + non-suppress cases

Test plan

  • npx vitest run --coverage=false src/messaging/silent-reply.test.ts src/messaging/send.test.ts (29 passed)
  • npx vitest run --coverage=false src/messaging (273 passed)
  • oxfmt --check on touched files
  • Live: heartbeat/background turn that ends with NO_REPLY no longer appears in WeChat chat
  • Live: normal text replies still deliver
  • Live: media + silent token still delivers media without the NO_REPLY caption

Skip delivering exact OpenClaw silent-reply tokens (NO_REPLY / no_reply)
from the WeChat outbound path so heartbeat/background turns no longer leak
the literal string to users. Mirror the host isSilentReplyText gate in
sendMessageWeixin, the reply deliver callback, and channel outbound sends.

Fixes Tencent#293
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] NO_REPLY 静默令牌被当作真实消息发送到微信

1 participant