Skip to content

Your lightweight open-source personal agent.

fix(cli): print response text when streaming fails in interactive mode

Kenneth Zhao105230cc340c
diff --git a/nanobot/cli/commands.py b/nanobot/cli/commands.py
index 241e052b5..d04dd52ef 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