From 7b65f1ca7a4d31101d1ff344b3925c1ef5f9da0b Mon Sep 17 00:00:00 2001 From: Hua Audio Date: Sun, 22 Mar 2026 06:09:59 +0100 Subject: [PATCH] Update pkg/channels/weixin/weixin.go Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- pkg/channels/weixin/weixin.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkg/channels/weixin/weixin.go b/pkg/channels/weixin/weixin.go index aba66872c..4db509174 100644 --- a/pkg/channels/weixin/weixin.go +++ b/pkg/channels/weixin/weixin.go @@ -286,6 +286,14 @@ func (c *WeixinChannel) Send(ctx context.Context, msg bus.OutboundMessage) error contextToken, _ = ct.(string) } + // If we don't have a context token for this user, we cannot send a valid reply. + // Treat this as a non-temporary error so the manager doesn't keep retrying. + if contextToken == "" { + logger.ErrorCF("weixin", "Missing context token, cannot send message", map[string]any{ + "to_user_id": toUserID, + }) + return fmt.Errorf("weixin send: missing context token for chat %s", toUserID) + } clientID := "picoclaw-" + uuid.New().String() req := SendMessageReq{