hermes - 💡(How to fix) Fix CLI resume can crash when printing restored cwd due to invalid Rich markup

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

Traceback:

Root Cause

Resuming a previous CLI session can crash while printing the restored working directory message. The crash appears to happen because an ANSI escape sequence is being interpolated inside Rich markup brackets:

RAW_BUFFERClick to expand / collapse

Resuming a previous CLI session can crash while printing the restored working directory message. The crash appears to happen because an ANSI escape sequence is being interpolated inside Rich markup brackets:

f"[{_DIM}]{_escape(msg)}[/]"

where _DIM is an ANSI escape sequence, not a Rich style name. Rich treats bracket contents as markup style names, so the closing [/] can raise a MarkupError.

Steps to Reproduce:

  1. Have a previous Hermes CLI session with a stored working directory.
  2. Start Hermes from a different working directory.
  3. Resume that previous session: 'hermes --resume <session-id-with-stored-cwd>' or 'hermes sessions browse' and choose a previous session with a stored cwd

Expected Behavior: Hermes resumes the previous session and prints the restored working directory message without crashing. Actual Behavior: Hermes prints the resumed session message, then crashes while restoring/printing the session cwd.

Traceback:

rich.errors.MarkupError: closing tag '[/]' at position 40 has nothing to close

Relevant stack frame:

File ".../cli.py", line 5401, in _restore_session_cwd self._console_print(f"[{_DIM}]{_escape(msg)}[/]")

Environment

• OS: Windows 10 • Shell: Git Bash / MINGW64 • Hermes version: v0.15.1 • Python environment: bundled Hermes venv

Replacing the ANSI escape-sequence-based Rich tag with Rich's native style markup, for example [dim italic], fixes the crash locally.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING