fix(cli): hold agent status lines until the streamed response box closes

Subagent completion notices ("✓ [set 7 · 2/2] … (2175.14s)"), background
process notices and spinner print_above text are emitted from worker threads
through agent._print_fn. In the interactive CLI that was bound straight to
_cprint, so a notice landing while a reply streamed was printed between two
paragraphs inside the response box.

_print_fn is now HermesCLI._agent_status_print: while a response or reasoning
box is open the line is parked in _held_status_lines and released right after
the box footer; outside a box it prints immediately as before. Gateway, ACP
and TUI printers are untouched (they never bound _cprint).
This commit is contained in:
Teknium
2026-09-09 09:32:32 -07:00
parent ecfcbb6276
commit b88e6776f4
4 changed files with 83 additions and 6 deletions
+2 -1
View File
@@ -2619,7 +2619,8 @@ class HermesCLI(CLIProcessNotificationsMixin, CLIAgentSetupMixin, CLICommandsMix
# Streaming display state
self._stream_buf = "" # partial line buffer
self._reasoning_preview_buf = "" # coalesces tiny reasoning chunks
self._stream_started = self._stream_box_opened = False
self._stream_started = self._stream_box_opened = self._stream_box_live = False
self._held_status_lines: list[str] = [] # agent status lines parked while a box streams
# Possible markdown-table lines held until the block ends for wcwidth-aware re-padding.
self._stream_table_buf: list[str] = []
self._in_stream_table = False