hermes - 💡(How to fix) Fix CLI session-name coalescing swallows real top-level subcommands like 'logs', 'debug', and 'claw' [1 participants]

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…
GitHub stats
NousResearch/hermes-agent#12649Fetched 2026-04-20 12:17:40
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0
Participants

Root Cause

Bug Description

Unquoted session names passed via -c/--continue or -r/--resume can absorb real top-level subcommands because _coalesce_session_name_args() uses a stale hardcoded subcommand allowlist.

Code Example

from hermes_cli.main import _coalesce_session_name_args

_coalesce_session_name_args(['-c', 'my', 'project', 'logs'])
# actual: ['-c', 'my project logs']

---

hermes -c my project logs
RAW_BUFFERClick to expand / collapse

Bug Description

Unquoted session names passed via -c/--continue or -r/--resume can absorb real top-level subcommands because _coalesce_session_name_args() uses a stale hardcoded subcommand allowlist.

Affected files / lines

  • hermes_cli/main.py:4107-4113_SUBCOMMANDS allowlist
  • hermes_cli/main.py:5989 — coalescing happens before argparse
  • Missing real top-level commands include:
    • debug at hermes_cli/main.py:5008-5009
    • claw at hermes_cli/main.py:5690-5691
    • logs at hermes_cli/main.py:5921-5922

Why this is a bug

The pre-parser stops collecting tokens only when it sees another flag or a name in _SUBCOMMANDS. Because _SUBCOMMANDS is incomplete, valid commands can be silently folded into the session title.

Minimal reproduction / evidence

from hermes_cli.main import _coalesce_session_name_args

_coalesce_session_name_args(['-c', 'my', 'project', 'logs'])
# actual: ['-c', 'my project logs']

That means a user command like:

hermes -c my project logs

can be interpreted as "resume chat session named my project logs" instead of invoking the logs command.

Expected Behavior

Top-level commands such as logs, debug, and claw should remain command boundaries when coalescing unquoted session names.

Actual Behavior

They are swallowed into the session name unless the user explicitly quotes the session name.

Suggested investigation direction

  • Derive the stop-list from the actual parser / registered top-level subcommands instead of a hand-maintained set.
  • Add regressions for at least logs, debug, and claw.

extent analysis

TL;DR

Update the _SUBCOMMANDS allowlist in hermes_cli/main.py to include all registered top-level subcommands, such as debug, claw, and logs, to prevent them from being absorbed into session names.

Guidance

  • Review the current implementation of _coalesce_session_name_args() and _SUBCOMMANDS in hermes_cli/main.py to understand how session names are coalesced and how the allowlist is used.
  • Derive the stop-list from the actual parser or registered top-level subcommands instead of maintaining a hand-maintained set to ensure accuracy and prevent missing commands.
  • Add regression tests for at least logs, debug, and claw to verify that they are not absorbed into session names when used with unquoted session names.
  • Consider updating the documentation to reflect the expected behavior and any changes made to the _SUBCOMMANDS allowlist.

Example

# Example of how to derive the stop-list from the actual parser
import argparse

parser = argparse.ArgumentParser()
subcommands = [subcommand for subcommand in parser._subparsers._actions]
_SUBCOMMANDS = [subcommand.dest for subcommand in subcommands]

Notes

This solution assumes that the argparse library is being used to parse commands and that the _SUBCOMMANDS allowlist is the only factor in determining whether a command is absorbed into a session name. Additional testing and verification may be necessary to ensure that this solution works as expected in all scenarios.

Recommendation

Apply workaround by updating the _SUBCOMMANDS allowlist to include all registered top-level subcommands, as this will prevent valid commands from being silently folded into session titles.

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

hermes - 💡(How to fix) Fix CLI session-name coalescing swallows real top-level subcommands like 'logs', 'debug', and 'claw' [1 participants]