fix(cli): stop spinner before resumed answer deltas

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Xubin Ren
2026-05-13 09:18:59 +00:00
co-authored by Cursor
parent 53831e1611
commit 567e95dee6
2 changed files with 23 additions and 2 deletions
+5 -2
View File
@@ -143,10 +143,13 @@ class StreamRenderer:
return self._header_printed
def ensure_header(self) -> None:
"""Print the assistant header once, before trace or answer content."""
"""Stop transient status and print the assistant header once."""
# A turn can print trace rows before the final answer, then restart the
# spinner while tools run. The next answer delta still needs to stop
# that spinner even though the header was already printed.
self._stop_spinner()
if self._header_printed:
return
self._stop_spinner()
self._console.print()
header = f"{self._bot_icon} {self._bot_name}" if self._bot_icon else self._bot_name
self._console.print(f"[cyan]{header}[/cyan]")