mirror of
https://github.com/HKUDS/nanobot.git
synced 2026-06-15 15:24:06 +00:00
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 <noreply@anthropic.com>
This commit is contained in:
parent
9c492143b4
commit
4dd5b62f11
@ -1063,7 +1063,7 @@ class WebSocketChannel(BaseChannel):
|
|||||||
buffered.append(delta)
|
buffered.append(delta)
|
||||||
full_text = "".join(buffered)
|
full_text = "".join(buffered)
|
||||||
rewritten = self._media.rewrite_local_markdown_images(full_text)
|
rewritten = self._media.rewrite_local_markdown_images(full_text)
|
||||||
if rewritten != full_text:
|
if full_text:
|
||||||
body["text"] = rewritten
|
body["text"] = rewritten
|
||||||
else:
|
else:
|
||||||
body = {
|
body = {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user