Skip to content

The agent that grows with you

fix(chat): the gateway REPL keeps the in-process CLI's prompt and submit shape

teknium167af4b86d2c7
diff --git a/hermes_cli/gateway_chat_view.py b/hermes_cli/gateway_chat_view.py
index c83d661a861..f760be085ab 100644
--- a/hermes_cli/gateway_chat_view.py
+++ b/hermes_cli/gateway_chat_view.py
@@ -236,20 +236,24 @@ class GatewayChatView:
return 0 if outcome == "completed" else 1
from prompt_toolkit import PromptSession
from prompt_toolkit.patch_stdout import patch_stdout
- from hermes_cli.skin_engine import get_active_skin
+ from hermes_cli.skin_engine import get_active_prompt_symbol, get_active_skin
welcome = "Welcome to Hermes Agent! Type your message or /help for commands."
print(get_active_skin().get_branding("welcome", welcome), flush=True)
- prompt = PromptSession()
+ prompt = PromptSession(erase_when_done=True)
+ prompt_symbol = get_active_prompt_symbol("❯ ")
with patch_stdout():
while not self.failure:
try:
- text = (await prompt.prompt_async("You> ")).strip()
+ text = (await prompt.prompt_async(prompt_symbol)).strip()
if not text:
continue
if text.startswith("/"):
if not await self.command(text):
return 0
else:
+ # Same scrollback shape as the in-process CLI: the typed prompt line is
+ # erased on submit and the message lands as a `●` preview row.
+ print(f"\n{'─' * 40}\n● {text}", flush=True)
await self.submit(text)
except KeyboardInterrupt:
print("Use /stop to interrupt execution, /quit to detach.")
diff --git a/tests/e2e/core/cli_tmux/test_resize_scrollback.py b/tests/e2e/core/cli_tmux/test_resize_scrollback.py
index bed57e44c73..6608d08da30 100644
--- a/tests/e2e/core/cli_tmux/test_resize_scrollback.py
+++ b/tests/e2e/core/cli_tmux/test_resize_scrollback.py
@@ -71,7 +71,7 @@ def test_resizes_keep_each_transcript_line_once_in_tmux_scrollback(tmp_path: Pat
write_hermes_home(home / ".hermes", llm.base_url)
env = {k: v for k, v in os.environ.items() if not k.startswith(("HERMES_", "TMUX"))}
env.update(HOME=str(home), HERMES_HOME=str(home / ".hermes"), PYTHONPATH=str(REPO_ROOT),
- TERM="xterm-256color")
+ TERM="xterm-256color", HERMES_STATE_DB_GUARD_BYPASS="1")
argv = [sys.executable, "-m", "hermes_cli.main", "chat", "--cli", "--yolo"]
subprocess.run(["tmux", "-L", sock, "-f", os.devnull, "new-session", "-d", "-s", "p", "-x", "120",
"-y", "24", "-c", str(tmp_path / "work"), *argv], env=env, check=True, timeout=30)