From fd4c6711b9fef4d252e6f7626a9c8dd682109bae Mon Sep 17 00:00:00 2001 From: stevef Date: Mon, 13 Apr 2026 22:00:25 +0200 Subject: [PATCH] fix: enforce content-first delivery order for WebSocket bridge stability --- pkg/channels/pico/pico.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkg/channels/pico/pico.go b/pkg/channels/pico/pico.go index a92ba55b7..d5a71ba77 100644 --- a/pkg/channels/pico/pico.go +++ b/pkg/channels/pico/pico.go @@ -252,7 +252,13 @@ func (c *PicoChannel) Send(ctx context.Context, msg bus.OutboundMessage) ([]stri "content": msg.Content, }) - return nil, c.broadcastToSession(msg.ChatID, outMsg) + err := c.broadcastToSession(msg.ChatID, outMsg) + + // Send typing stop after the message is delivered + stopMsg := newMessage(TypeTypingStop, nil) + _ = c.broadcastToSession(msg.ChatID, stopMsg) + + return nil, err } // EditMessage implements channels.MessageEditor.