From 105230cc340c39dd46eac0ced4c4d6888c933296 Mon Sep 17 00:00:00 2001 From: Kenneth Zhao Date: Wed, 1 Jul 2026 20:56:27 +0000 Subject: [PATCH] fix(cli): print response text when streaming fails in interactive mode --- nanobot/cli/commands.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/nanobot/cli/commands.py b/nanobot/cli/commands.py index 241e052b..d04dd52e 100644 --- a/nanobot/cli/commands.py +++ b/nanobot/cli/commands.py @@ -1938,6 +1938,17 @@ def agent( ) continue if isinstance(event, StreamedResponseEvent): + if msg.content and renderer and not renderer.streamed: + await renderer.close() + print_kwargs: dict[str, Any] = {} + if renderer.header_printed: + print_kwargs["show_header"] = False + _print_agent_response( + msg.content, + render_markdown=markdown, + metadata=msg.metadata, + **print_kwargs, + ) turn_done.set() continue