From edd339e05603d187db0e7bad65462b393aa3d660 Mon Sep 17 00:00:00 2001 From: Zhang Rui Date: Sun, 1 Mar 2026 00:02:22 +0800 Subject: [PATCH] fix(wecom): handle empty response by encrypting and returning a default response --- pkg/channels/wecom/aibot.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/channels/wecom/aibot.go b/pkg/channels/wecom/aibot.go index e9eda6810..4bd8adb98 100644 --- a/pkg/channels/wecom/aibot.go +++ b/pkg/channels/wecom/aibot.go @@ -433,6 +433,11 @@ func (c *WeComAIBotChannel) handleMessageCallback( // Process the message and get streaming response response := c.processMessage(ctx, msg, timestamp, nonce) + // Check if response is empty (e.g. due to unsupported message type) + if response == "" { + response = c.encryptEmptyResponse(timestamp, nonce) + } + // Return encrypted JSON response w.Header().Set("Content-Type", "application/json; charset=utf-8") w.WriteHeader(http.StatusOK)