Skip to content

The agent that grows with you

fix(cli): close the user message with its own bar, as classic does

Tekniumd4ed464fb571
diff --git a/hermes_cli/cli_stream_mixin.py b/hermes_cli/cli_stream_mixin.py
index d8c3fa2a687..c5302c2c1bd 100644
--- a/hermes_cli/cli_stream_mixin.py
+++ b/hermes_cli/cli_stream_mixin.py
@@ -253,7 +253,10 @@ class CLIStreamMixin:
else:
ChatConsole().print(f"[bold {_accent_hex()}]●[/] [bold]{_escape(text)}[/]")
if modern:
+ # Close the message with its own bar (as classic does), then a blank line before
+ # whatever the turn prints first.
from hermes_cli.cli_modern_layout import owe_gap_after_user_message
+ _cprint(separator(True))
owe_gap_after_user_message()
def _stream_reasoning_delta(self, text: str) -> None:
diff --git a/tests/hermes_cli/test_cli_modern_layout.py b/tests/hermes_cli/test_cli_modern_layout.py
index e544432fc70..22cb5e00bcd 100644
--- a/tests/hermes_cli/test_cli_modern_layout.py
+++ b/tests/hermes_cli/test_cli_modern_layout.py
@@ -182,9 +182,8 @@ def test_tool_rows_keep_the_classic_tool_emoji():
def test_a_blank_line_separates_the_user_message_from_the_first_tool_row(monkeypatch):
- """Reasoning and answers open under a blank line + bar; the first tool row of a turn gets the
- same blank line, so the user's message never runs straight into the tool calls. Later rows
- stay tight."""
+ """The user's message closes with its own bar, and the first tool row opens under a blank line,
+ so the message never runs straight into the tool calls. Later rows stay tight."""
from cli import HermesCLI
import cli as climod
from hermes_cli import cli_modern_layout as layout
@@ -194,6 +193,7 @@ def test_a_blank_line_separates_the_user_message_from_the_first_tool_row(monkeyp
cli = HermesCLI.__new__(HermesCLI)
cli._modern_layout, cli.show_timestamps = True, False
cli._print_user_message_preview("read the hostname")
+ assert emitted[-1] == "─" * 40, emitted # the message closes with its own bar
first = layout.completed_tool_line(cli, "read_file", {"path": "/etc/hostname"}, 0.2)
second = layout.completed_tool_line(cli, "terminal", {"command": "echo hi"}, 0.1)
assert first.startswith("\n") and _plain(first).lstrip("\n").startswith("📖 "), repr(first)