From 4dd5b62f11ca8efff489284c1e39185dcaf3f307 Mon Sep 17 00:00:00 2001 From: Syoc Date: Tue, 9 Jun 2026 21:24:53 +0200 Subject: [PATCH] fix(websocket): always send text in stream_end when stream had content The channel manager coalesces consecutive _stream_delta messages and forwards a single merged message with _stream_end=True. In that path no individual delta events ever reach the WebUI client, so the stream_end frame is the only carrier of the text. The previous guard only attached text when media-URL rewriting changed the string, which silently dropped entire turns of plain-text output whenever the agent generated tokens faster than the queue drained. Co-Authored-By: Claude Opus 4.7 --- nanobot/channels/websocket.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nanobot/channels/websocket.py b/nanobot/channels/websocket.py index 9527c0dd7..62eb04cc5 100644 --- a/nanobot/channels/websocket.py +++ b/nanobot/channels/websocket.py @@ -1063,7 +1063,7 @@ class WebSocketChannel(BaseChannel): buffered.append(delta) full_text = "".join(buffered) rewritten = self._media.rewrite_local_markdown_images(full_text) - if rewritten != full_text: + if full_text: body["text"] = rewritten else: body = {