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:
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
Bug Description
/queuedeclaresqas an alias, but the alias is shadowed by/quitbecause both commands registerqand the flat lookup keeps the later entry.Affected files
hermes_cli/commands.py:87-88—/queuedeclaresaliases=("q",)hermes_cli/commands.py:163-164—/quitalso declaresaliases=("exit", "q")hermes_cli/commands.py:174-178—_build_command_lookup()overwrites duplicate aliases silentlytests/hermes_cli/test_commands.py:97-104— current test suite codifiesq -> quit, so the collision is not caughtWhy this is a bug
The registry explicitly advertises
qas an alias for/queue, but in practiceresolve_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
Actual output:
quitquitExpected 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
/quitentry overwrites/queue'sqalias in_COMMAND_LOOKUP, so/qexits instead of queueing a prompt.Suggested investigation direction
COMMAND_REGISTRY/_COMMAND_LOOKUPqshould belong to/queueor/quittests/hermes_cli/test_commands.pyso collisions fail instead of being normalized into expected behavior