Update pkg/channels/wecom/aibot.go

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
ZHANG RUI
2026-02-28 15:31:39 +08:00
committed by Zhang Rui
parent aa9ce6955b
commit 0b6d913dfc
+3
View File
@@ -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 {