The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
fix(cli): bring back the separator bars in the glyph layout
Teknium9dd4a23bbc01
diff --git a/hermes_cli/cli_chat_turn_mixin.py b/hermes_cli/cli_chat_turn_mixin.pyindex 1e7148455fe..f4111e436cd 100644--- a/hermes_cli/cli_chat_turn_mixin.py+++ b/hermes_cli/cli_chat_turn_mixin.py@@ -630,9 +630,9 @@ class CLIChatTurnMixin:if self.show_reasoning and turn.result and not self._reasoning_shown_this_turn:reasoning = turn.result.get("last_reasoning")if reasoning and getattr(self, "_modern_layout", False):- from hermes_cli.cli_modern_layout import thought_body, thought_line- _cprint("\n" + thought_line(None, reasoning))- for line in thought_body(reasoning) if self.reasoning_full else []:+ from hermes_cli.cli_modern_layout import thought_rows+ _cprint("")+ for line in thought_rows(None, reasoning, self.reasoning_full):_cprint(line)elif reasoning:w = self._scrollback_box_width()diff --git a/hermes_cli/cli_modern_layout.py b/hermes_cli/cli_modern_layout.pyindex eb71c807854..395c7f8f898 100644--- a/hermes_cli/cli_modern_layout.py+++ b/hermes_cli/cli_modern_layout.py@@ -67,17 +67,27 @@ def prompt_glyph() -> str:# ── transcript rows (printed into scrollback) ───────────────────────────────────────────────+# Fixed width, not the terminal's: a 40-cell rule never re-wraps on resize (classic's user rule).+_SEPARATOR_WIDTH = 40+++def separator(accent: bool) -> str:+ """The bar above each user message and answer (accent) or reasoning block (dim)."""+ color = _fg(_skin_hex("ui_accent", "#FFBF00")) if accent else _DIM+ return f"{color}{'─' * _SEPARATOR_WIDTH}{_RST}"++def user_echo_markup(text: str, accent_hex: str, ts_suffix: str = "") -> str:- """Rich markup for a submitted single-line user message: ``❯ text``, no surrounding rules."""+ """Rich markup for a submitted single-line user message: ``❯ text``."""from rich.markup import escape- return f"\n[bold {accent_hex}]{escape(prompt_glyph())}[/] [bold]{escape(text)}[/]{ts_suffix}"+ return f"[bold {accent_hex}]{escape(prompt_glyph())}[/] [bold]{escape(text)}[/]{ts_suffix}"def answer_label(timestamp: str = "") -> str:- """The line that opens an answer: the skin's brand glyph + name, replacing the framed header."""+ """The rows that open an answer: the accent bar, then the skin's brand glyph + name."""glyph, name = _brand_glyph()stamp = f" {_DIM}{timestamp}{_RST}" if timestamp else ""- return f"\n{_fg(_skin_hex('ui_accent', '#FFBF00'), bold=True)}{glyph} {name}{_RST}{stamp}"+ return f"\n{separator(True)}\n{_fg(_skin_hex('ui_accent', '#FFBF00'), bold=True)}{glyph} {name}{_RST}{stamp}"def thought_title(text: str) -> str:@@ -102,6 +112,11 @@ def thought_body(text: str) -> list[str]:return [f"\x1b[2;3m│ {line}{_RST}" if line.strip() else "\x1b[2;3m│\x1b[0m" for line in text.strip().splitlines()]+def thought_rows(seconds: float | None, text: str, full: bool) -> list[str]:+ """A reasoning block's scrollback rows: dim bar, collapsed line, and the body under ``full``."""+ return [separator(False), thought_line(seconds, text), *(thought_body(text) if full else [])]++def completed_tool_line(cli, function_name: str, args: dict | None, duration: float, result=None,is_error: bool = False) -> str:"""The scrollback line for a finished tool call in the active layout."""diff --git a/hermes_cli/cli_stream_mixin.py b/hermes_cli/cli_stream_mixin.pyindex 563ba7fdd92..ef5f7decf05 100644--- a/hermes_cli/cli_stream_mixin.py+++ b/hermes_cli/cli_stream_mixin.py@@ -230,7 +230,7 @@ class CLIStreamMixin:def _print_user_message_preview(self, user_input: str) -> None:"""Render a user message using the normal chat scrollback style."""- from cli import ChatConsole, _accent_hex+ from cli import ChatConsole, _accent_hex, _cprintfrom tools.process_registry_notifications import TimelineNotificationif isinstance(user_input, TimelineNotification):from gateway.warning_notifications import render_notification@@ -238,11 +238,14 @@ class CLIStreamMixin:platform="cli", diagnostic=user_input.notification_category == "diagnostic")returnmodern = getattr(self, "_modern_layout", False)- if not modern:+ if modern:+ from hermes_cli.cli_modern_layout import separator+ _cprint("\n" + separator(True))+ else:ChatConsole().print(f"[{_accent_hex()}]{'─' * 40}[/]")text = str(user_input or "")if "\n" in text:- ChatConsole().print(("\n" if modern else "") + self._format_submitted_user_message_preview(text))+ ChatConsole().print(self._format_submitted_user_message_preview(text))elif modern:from hermes_cli.cli_modern_layout import user_echo_markupChatConsole().print(user_echo_markup(text, _accent_hex()))@@ -309,11 +312,10 @@ class CLIStreamMixin:if not getattr(self, "_reasoning_box_opened", False):returnif getattr(self, "_modern_layout", False):- from hermes_cli.cli_modern_layout import thought_body, thought_line+ from hermes_cli.cli_modern_layout import thought_rowstext = getattr(self, "_reasoning_buf", "")started = getattr(self, "_reasoning_started_at", 0.0)- _cprint(thought_line(time.monotonic() - started if started else None, text))- for line in thought_body(text) if self.reasoning_full else []:+ for line in thought_rows(time.monotonic() - started if started else None, text, self.reasoning_full):_cprint(line)self._reasoning_buf, self._reasoning_box_opened = "", Falseif not getattr(self, "_stream_box_live", False):diff --git a/tests/hermes_cli/test_cli_modern_layout.py b/tests/hermes_cli/test_cli_modern_layout.pyindex bf9ff26f812..dc8f1ab2ca0 100644--- a/tests/hermes_cli/test_cli_modern_layout.py+++ b/tests/hermes_cli/test_cli_modern_layout.py@@ -40,6 +40,10 @@ def test_glyph_layout_scrollback_is_width_independent(monkeypatch, modern):assert len(thought) == 1 and "Planning the change" in thought[0], wideassert "I will read calc.py first." not in "\n".join(wide) # collapsed unless /reasoning fullassert any("Added multiply to calc.py." in line for line in wide)+ # Reasoning and the answer each open under a fixed-width bar (so it never re-wraps on resize).+ rows = "\n".join(wide).split("\n")+ assert rows[rows.index(thought[0]) - 1] == "─" * 40, rows+ assert rows[next(i for i, r in enumerate(rows) if r.startswith("☤ Hermes")) - 1] == "─" * 40, rows@pytest.mark.parametrize("modern", [True, False])