hermes - ✅(Solved) Fix CLI command alias collision: /q resolves to quit, making queue shorthand unreachable [1 pull requests, 1 comments, 2 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#14712Fetched 2026-04-24 06:15:09
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Timeline (top)
labeled ×3commented ×1

Fix Action

Fixed

PR fix notes

PR #14957: fix: stabilization fixes and architectural enhancements

Description (problem / solution / changelog)

Summary of Changes

  • Resolved /q alias collision (Fixes #14712)
  • Implemented skill prompt cache invalidation for dynamic skill/tool toggling.
  • Added guard for on_session_finalize(session_id=None) in gateway (Fixes #12176)
  • Implemented WSL2/Windows TCP keepalive workaround for stability.
  • Added session_name support for cron jobs for session persistence.
  • Refined LLM tool-use feedback for pending approvals.
  • Optimized plugin hook order for assistant response overrides.

Details

This PR addresses several critical stability issues and architectural enhancements to improve the Hermes Agent's reliability across platforms and its overall user experience.

Related Issues

Fixes #14712, #12176

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Architectural improvement

Changed files

  • cli.py (modified, +1/-1)
  • cron/jobs.py (modified, +2/-0)
  • cron/scheduler.py (modified, +3/-1)
  • gateway/platforms/api_server.py (modified, +14/-0)
  • gateway/platforms/whatsapp.py (modified, +1/-1)
  • gateway/run.py (modified, +4/-3)
  • hermes_cli/config.py (modified, +22/-1)
  • hermes_cli/skills_config.py (modified, +5/-0)
  • hermes_cli/tools_config.py (modified, +5/-0)
  • run_agent.py (modified, +106/-33)
  • scratch/test_proxy.py (added, +16/-0)
  • tools/cronjob_tools.py (modified, +9/-0)
  • tools/delegate_tool.py (modified, +31/-4)
  • tools/image_generation_tool.py (modified, +57/-1)

Code Example

cd /Users/genie/.hermes/hermes-agent
source venv/bin/activate
python - <<'PY'
from hermes_cli.commands import resolve_command
for token in ["q", "queue", "quit"]:
    cmd = resolve_command(token)
    print(token, "->", None if cmd is None else cmd.name)
PY
RAW_BUFFERClick to expand / collapse

Bug Description

/q is registered as an alias for both queue and quit, but the command lookup silently lets the later quit registration win. As a result, the advertised queue shorthand is unreachable and /q ... resolves as quit instead of queue.

Affected files / lines

  • hermes_cli/commands.py:87-88queue declares aliases=("q",)
  • hermes_cli/commands.py:163-164quit also declares aliases=("exit", "q")
  • hermes_cli/commands.py:172-179_build_command_lookup() overwrites alias collisions with the later command

Why this is a bug

The registry exposes conflicting aliases with no collision check. Runtime resolution becomes order-dependent and breaks one of the commands. A user typing /q hello cannot queue input; the token canonicalizes to quit.

Minimal reproduction

cd /Users/genie/.hermes/hermes-agent
source venv/bin/activate
python - <<'PY'
from hermes_cli.commands import resolve_command
for token in ["q", "queue", "quit"]:
    cmd = resolve_command(token)
    print(token, "->", None if cmd is None else cmd.name)
PY

Output:

  • q -> quit
  • queue -> queue
  • quit -> quit

Expected Behavior

/q should either:

  1. unambiguously resolve to the documented shorthand for queue, or
  2. be rejected at registry-build time as an alias collision.

Actual Behavior

/q always resolves to quit, making the queue alias unusable.

Suggested investigation direction

Add alias-collision validation in _build_command_lookup() (or at registry definition time), then decide which command should own q and update tests/help text accordingly.

extent analysis

TL;DR

Implement alias collision detection in _build_command_lookup() to prevent silent overwriting of aliases.

Guidance

  • Identify and prioritize commands with conflicting aliases, such as queue and quit, to determine which command should own the q alias.
  • Modify _build_command_lookup() to raise an error or warning when an alias collision is detected, preventing silent overwriting of aliases.
  • Update tests and help text to reflect the resolved alias ownership.
  • Consider implementing a mechanism to allow for explicit alias overrides or merging of commands with conflicting aliases.

Example

def _build_command_lookup():
    # ...
    if alias in existing_aliases:
        raise ValueError(f"Alias '{alias}' is already registered for command '{existing_aliases[alias]}'")
    # ...

Notes

The solution requires careful consideration of command priorities and alias ownership to ensure consistent and expected behavior.

Recommendation

Apply workaround by implementing alias collision detection and resolution in _build_command_lookup(), as this will allow for a more robust and maintainable solution.

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 - ✅(Solved) Fix CLI command alias collision: /q resolves to quit, making queue shorthand unreachable [1 pull requests, 1 comments, 2 participants]