From 0b6d913dfca4b72f56703799c14809ef4cdc629f Mon Sep 17 00:00:00 2001 From: ZHANG RUI Date: Sat, 28 Feb 2026 15:31:39 +0800 Subject: [PATCH] Update pkg/channels/wecom/aibot.go Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- pkg/channels/wecom/aibot.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/channels/wecom/aibot.go b/pkg/channels/wecom/aibot.go index d26ed9066..7924f38e6 100644 --- a/pkg/channels/wecom/aibot.go +++ b/pkg/channels/wecom/aibot.go @@ -181,6 +181,9 @@ func (c *WeComAIBotChannel) Stop(ctx context.Context) error { // It writes into the earliest unfinished task in the queue (FIFO per chatID). // If the stream has already closed (deadline passed), it posts directly to response_url. func (c *WeComAIBotChannel) Send(ctx context.Context, msg bus.OutboundMessage) error { + if !c.IsRunning() { + return channels.ErrNotRunning + } c.taskMu.Lock() queue := c.chatTasks[msg.ChatID] for len(queue) > 0 && queue[0].Finished {