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-88 — queue declares aliases=("q",)
hermes_cli/commands.py:163-164 — quit 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:
- unambiguously resolve to the documented shorthand for
queue, or
- 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.
Bug Description
/qis registered as an alias for bothqueueandquit, but the command lookup silently lets the laterquitregistration 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-88—queuedeclaresaliases=("q",)hermes_cli/commands.py:163-164—quitalso declaresaliases=("exit", "q")hermes_cli/commands.py:172-179—_build_command_lookup()overwrites alias collisions with the later commandWhy 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 hellocannot queue input; the token canonicalizes toquit.Minimal reproduction
Output:
q -> quitqueue -> queuequit -> quitExpected Behavior
/qshould either:queue, orActual Behavior
/qalways resolves toquit, 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 ownqand update tests/help text accordingly.