Skip to content

CLI command alias collision: /q resolves to quit, making queue shorthand unreachable #14712

@NewTurn2017

Description

@NewTurn2017

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low — cosmetic, nice to havecomp/cliCLI entry point, hermes_cli/, setup wizardtype/bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions