The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
fix(cli): glyph layout tool rows keep the classic tool emoji
Tekniumfa10b9cb248e
diff --git a/agent/display.py b/agent/display.pyindex f8161010098..6003b53f334 100644--- a/agent/display.py+++ b/agent/display.py@@ -1080,15 +1080,16 @@ def _cute_path(p) -> str:class _CuteRow(str):- """A rendered completion row that also keeps its verb and detail, so the CLI's glyph layout- can rebuild the row without re-parsing the padded ``┊ emoji verb`` string."""+ """A rendered completion row that also keeps its emoji, verb and detail, so the CLI's glyph+ layout can rebuild the row without re-parsing the padded ``┊ emoji verb`` string."""+ emoji: strverb: strdetail: str- def __new__(cls, text: str, verb: str, detail: str):+ def __new__(cls, text: str, emoji: str, verb: str, detail: str):row = super().__new__(cls, text)- row.verb, row.detail = verb, detail+ row.emoji, row.verb, row.detail = emoji.strip(), verb, detailreturn rowdef __reduce__(self): # copy/pickle as a plain str; the custom __new__ can't be re-called bare@@ -1098,12 +1099,12 @@ class _CuteRow(str):def _cute_row(emoji: str, verb: str, detail: str = "") -> str:"""``┊ {emoji} {verb:9} {detail}`` -- verb column from ``display.cute.verb.<verb>`` (9 cells wide)."""label = t(f'display.cute.verb.{verb}')- return _CuteRow(f"┊ {emoji} {label:9} {detail}", label, detail)+ return _CuteRow(f"┊ {emoji} {label:9} {detail}", emoji, label, detail)def get_tool_row_parts(tool_name: str, args: dict | None, result: str | None = None, *, is_error: bool = False):- """``[(verb, detail, failure), ...]`` for one completed call: the labels the ``┊`` line uses,- without its emoji and padding. ``failure`` is None for a row that succeeded, else that row's+ """``[(emoji, verb, detail, failure), ...]`` for one completed call: the parts the ``┊`` line+ uses, without its padding. ``failure`` is None for a row that succeeded, else that row'ssuffix (``" [exit 1]"``, possibly ``""``); batch calls mark the entry that failed."""try:args = redact_tool_args_for_display(tool_name, args) or args or {}@@ -1115,16 +1116,17 @@ def get_tool_row_parts(tool_name: str, args: dict | None, result: str | None = Nmarks = [s or None for s in suffixes]if call_failure is not None and not any(suffixes):marks[-1] = call_failure # the call failed without naming an entry- return [(_cute_trunc(lb.text), _cute_trunc(lb.preview) if lb.preview else "", mark)+ return [(lb.emoji, _cute_trunc(lb.text), _cute_trunc(lb.preview) if lb.preview else "", mark)for lb, mark in zip(labels, marks)]render = _CUTE_LINES.get(tool_name)row = render(args, result) if render else Noneif isinstance(row, _CuteRow):- return [(row.verb, row.detail, call_failure)]- return [(tool_name, _cute_trunc(build_tool_preview(tool_name, args) or ""), call_failure)]+ return [(row.emoji, row.verb, row.detail, call_failure)]+ return [(get_tool_emoji(tool_name), tool_name, _cute_trunc(build_tool_preview(tool_name, args) or ""),+ call_failure)]except Exception:logger.debug("Tool row parts failed for %s", tool_name, exc_info=True)- return [(str(tool_name), "", None)]+ return [("⚡", str(tool_name), "", None)]def _cute_web_extract(a: dict, _r) -> str:diff --git a/hermes_cli/cli_modern_layout.py b/hermes_cli/cli_modern_layout.pyindex 5351af66d4f..373588e8fb2 100644--- a/hermes_cli/cli_modern_layout.py+++ b/hermes_cli/cli_modern_layout.py@@ -135,13 +135,15 @@ def completed_tool_line(cli, function_name: str, args: dict | None, duration: fldef tool_row(function_name: str, args: dict | None, duration: float, result=None, is_error: bool = False) -> str:- """``● Read calc.py 0.2s`` / ``✗ Ran $ pytest -q 0.4s [exit 1]`` — one row per completed call."""+ """``📖 Read calc.py 0.2s`` / ``✗ $ pytest -q 0.4s [exit 1]`` — one row per completed call, led by+ the tool's emoji (the classic ``┊`` row's), or a red ``✗`` when that entry failed."""from agent.display import get_tool_row_partsrows = get_tool_row_parts(function_name, args or {}, result, is_error=bool(is_error))out = []- for index, (verb, detail, suffix) in enumerate(rows):+ for index, (emoji, verb, detail, suffix) in enumerate(rows):verb = (verb or function_name).strip()- line = f"{f'{_RED}✗{_RST}' if suffix is not None else '●'} {_BOLD}{verb[:1].upper()}{verb[1:]}{_RST}"+ mark = f"{_RED}✗{_RST}" if suffix is not None else (emoji or "●")+ line = f"{mark} {_BOLD}{verb[:1].upper()}{verb[1:]}{_RST}"if detail:line += f" {detail}"if index == len(rows) - 1 and duration >= 0.1:diff --git a/hermes_cli/cli_stream_mixin.py b/hermes_cli/cli_stream_mixin.pyindex 9d8d8c9fc65..9cc5eea3ca9 100644--- a/hermes_cli/cli_stream_mixin.py+++ b/hermes_cli/cli_stream_mixin.py@@ -705,7 +705,7 @@ class CLIStreamMixin:from agent.display import bridge_generating_phrase, get_tool_emojiwhat = bridge_generating_phrase(tool_name) or tool_nameif getattr(self, "_modern_layout", False): # the composer rule shows it; scrollback stays quiet- self._spinner_text = t("cli.modern.preparing", what=what)+ self._spinner_text = f"{get_tool_emoji(tool_name, default='⚡')} {t('cli.modern.preparing', what=what)}"self._invalidate()return_cprint(f" ┊ {t('cli.stream.tool_preparing', emoji=get_tool_emoji(tool_name, default='⚡'), what=what)}")diff --git a/tests/hermes_cli/test_cli_modern_layout.py b/tests/hermes_cli/test_cli_modern_layout.pyindex 28ef3dea42c..43c51da5e3a 100644--- a/tests/hermes_cli/test_cli_modern_layout.py+++ b/tests/hermes_cli/test_cli_modern_layout.py@@ -164,3 +164,17 @@ def test_long_user_message_soft_wraps_so_a_resize_reflows_it(monkeypatch):out[width] = [line for line in "\n".join(emitted).split("\n") if line.strip()]assert out[60] == out[140], outassert any(line.rstrip().endswith("word") and line.count("word") == 60 for line in out[60]), out[60]+++def test_tool_rows_keep_the_classic_tool_emoji():+ """Each finished tool row leads with the same emoji the classic ``┊`` row shows (📖 read, 💻+ terminal…); a failed entry swaps it for the red ✗ so failures stay obvious."""+ from agent.display import get_cute_tool_message+ from hermes_cli.cli_modern_layout import tool_row++ for name, args in (("read_file", {"path": "/etc/hostname"}), ("terminal", {"command": "echo ok"}),+ ("execute_code", {"code": "import math"})):+ classic_emoji = get_cute_tool_message(name, args, 0.2).split()[1]+ assert _plain(tool_row(name, args, 0.2)).startswith(classic_emoji + " "), (name, classic_emoji)+ failed = _plain(tool_row("terminal", {"command": "false"}, 0.2, result='{"exit_code": 1, "output": ""}'))+ assert failed.startswith("✗ ") and "[exit 1]" in failed, faileddiff --git a/website/docs/user-guide/cli.md b/website/docs/user-guide/cli.mdindex 89eb0d92c0d..1c2d0f48947 100644--- a/website/docs/user-guide/cli.md+++ b/website/docs/user-guide/cli.md@@ -180,8 +180,8 @@ acknowledge it before continuing. Do not resend the queued input.```❯ add a multiply function and run the tests∴ Thought for 3s · Planning the change-● Read calc.py-● Patch 0.2s+📖 Read calc.py+🔧 Patch 0.2s│ calc.py│ @@ -1,2 +1,6 @@│ +def multiply(a, b):@@ -196,7 +196,7 @@ Added multiply; pytest isn't installed here, so I ran the tests directly: 2 passgpt-5-mini · ctx [░░░░░░░░] 4% · ~/project (main) enter interrupt · tab queue · ctrl+c stop```-- A 40-column bar opens each user message and answer (accent) and each reasoning block (dim); reasoning streams live as in classic and ends with a `∴ Thought for 3s · <title>` line. `❯` your message, `●` a finished tool call (`✗` in red when it failed, with its exit code), `│` an edit's diff under its row, `☤` the answer, and `─` the turn's summary line.+- A 40-column bar opens each user message and answer (accent) and each reasoning block (dim); reasoning streams live as in classic and ends with a `∴ Thought for 3s · <title>` line. `❯` your message, a finished tool call led by its emoji (`📖 Read`, `💻 $`; `✗` in red when it failed, with its exit code), `│` an edit's diff under its row, `☤` the answer, and `─` the turn's summary line.- The composer's top rule carries the live activity (spinner, what's running, elapsed time, streamed tokens) on the left and the session title on the right; no spinner row is printed into the scrollback.- The status line sits under the composer: the same fields as the classic status bar (model, context, cache hit, latency, tokens/s, background work, goal, duration, YOLO…) plus the working directory (with git branch) on the left; the keys that do something right now on the right.- The welcome banner is the same in both layouts.