Skip to content

Bug: /queue alias q is shadowed by /quit in command registry #10467

@NewTurn2017

Description

@NewTurn2017

Bug Description

/queue declares q as an alias, but the alias is shadowed by /quit because both commands register q and the flat lookup keeps the later entry.

Affected files

  • hermes_cli/commands.py:87-88/queue declares aliases=("q",)
  • hermes_cli/commands.py:163-164/quit also declares aliases=("exit", "q")
  • hermes_cli/commands.py:174-178_build_command_lookup() overwrites duplicate aliases silently
  • tests/hermes_cli/test_commands.py:97-104 — current test suite codifies q -> quit, so the collision is not caught

Why this is a bug

The registry explicitly advertises q as an alias for /queue, but in practice resolve_command("q") returns /quit. That makes one documented alias unusable and causes inconsistent behavior across autocomplete/help/dispatch surfaces built from the registry.

Minimal reproduction

cd /Users/genie/.hermes/hermes-agent
source venv/bin/activate
python - <<'PY'
from hermes_cli.commands import resolve_command
print(resolve_command('q').name)
print(resolve_command('/q').name)
PY

Actual output:

  • quit
  • quit

Expected Behavior

Each alias should resolve to the command that declares it, or the registry should reject duplicate aliases at import/test time.

Actual Behavior

The later /quit entry overwrites /queue's q alias in _COMMAND_LOOKUP, so /q exits instead of queueing a prompt.

Suggested investigation direction

  • Enforce alias uniqueness when building COMMAND_REGISTRY / _COMMAND_LOOKUP
  • Decide whether q should belong to /queue or /quit
  • Update tests/hermes_cli/test_commands.py so collisions fail instead of being normalized into expected behavior

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    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