From e88b39f21e6bb619b43081591be75a931897efe4 Mon Sep 17 00:00:00 2001 From: ZHANG RUI Date: Sat, 28 Feb 2026 15:54:00 +0800 Subject: [PATCH] Update pkg/channels/wecom/aibot.go Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- pkg/channels/wecom/aibot.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkg/channels/wecom/aibot.go b/pkg/channels/wecom/aibot.go index 4be430626..de1a50c4a 100644 --- a/pkg/channels/wecom/aibot.go +++ b/pkg/channels/wecom/aibot.go @@ -928,9 +928,12 @@ func (c *WeComAIBotChannel) encryptResponse( return string(respJSON) } -// encryptEmptyResponse returns empty encrypted response +// encryptEmptyResponse returns a minimal valid encrypted response func (c *WeComAIBotChannel) encryptEmptyResponse(timestamp, nonce string) string { - return "" + // Construct a zero-value stream response and encrypt it so that + // WeCom always receives a syntactically valid encrypted JSON object. + emptyResp := WeComAIBotStreamResponse{} + return c.encryptResponse("", timestamp, nonce, emptyResp) } // encryptMessage encrypts a plain text message for WeCom AI Bot