diff --git a/cli.py b/cli.py index 5b3ac83d7..cf41972bc 100755 --- a/cli.py +++ b/cli.py @@ -1465,7 +1465,7 @@ class HermesCLI: # Add user message to history self.conversation_history.append({"role": "user", "content": message}) - w = min(self.console.width, 80) + w = self.console.width _cprint(f"{_GOLD}{'─' * w}{_RST}") print(flush=True) @@ -1506,7 +1506,11 @@ class HermesCLI: # Drain any remaining agent output still in the StdoutProxy # buffer so tool/status lines render ABOVE our response box. + # The flush pushes data into the renderer queue; the short + # sleep lets the renderer actually paint it before we draw. + import time as _time sys.stdout.flush() + _time.sleep(0.15) # Update history with full conversation self.conversation_history = result.get("messages", self.conversation_history) if result else self.conversation_history @@ -1528,7 +1532,7 @@ class HermesCLI: response = response + "\n\n---\n_[Interrupted - processing new message]_" if response: - w = min(self.console.width, 80) + w = self.console.width label = " ⚕ Hermes " fill = w - 2 - len(label) # 2 for ╭ and ╮ top = f"{_GOLD}╭─{label}{'─' * max(fill - 1, 0)}╮{_RST}" @@ -1536,7 +1540,7 @@ class HermesCLI: # Render box + response as a single _cprint call so # nothing can interleave between the box borders. - _cprint(f"\n{top}\n\n{response}\n\n{bot}") + _cprint(f"\n{top}\n{response}\n\n{bot}") # If we have a pending message from interrupt, re-queue it for process_loop # instead of recursing (avoids unbounded recursion from rapid interrupts)