Skip to content

fix(cli): dispatch /whoami instead of reporting it unknown - #77920

Closed
MumuTW wants to merge 1 commit into
NousResearch:mainfrom
MumuTW:fix/cli-whoami-dispatch
Closed

MumuTW wants to merge 1 commit into
NousResearch:mainfrom
MumuTW:fix/cli-whoami-dispatch

Conversation

@MumuTW

@MumuTW MumuTW commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Fixes the live instance of #74594: /whoami is registered in
COMMAND_REGISTRY (advertised by /help and tab-completion) but
HermesCLI.process_command had no dispatch branch for it — typing
/whoami printed "Unknown command: /whoami".

  • cli.py — route canonical == "whoami" to _handle_whoami_command()
  • hermes_cli/cli_commands_mixin.py — handler reports the local operator's
    slash-command access: the classic CLI runs on the operator's own machine,
    so the operator is the local admin (unrestricted), mirroring the gateway's
    unrestricted tier when no admin list is configured for a scope
  • tests/cli/test_whoami_command.py — runtime dispatch wiring (handler spy,
    no "Unknown command" fall-through) + handler behavior

Related Issue

Fixes #74594
Refs #74595 (the parity guard lists /whoami in KNOWN_MISSING_DISPATCH;
drop the entry once this lands)

Type of Change

  • ✅ Bug fix (non-breaking change that fixes an issue)

Test Plan

./venv/bin/python -m pytest tests/cli/test_whoami_command.py tests/cli/test_indicator_command.py -q
# 11 passed

/whoami is registered in COMMAND_REGISTRY (hermes_cli/commands.py) and
advertised by /help and tab-completion, but HermesCLI.process_command had
no branch for it — typing /whoami printed "Unknown command". This is the
NousResearch#74594 bug class (registered command, missing CLI dispatch).

- cli.py: route canonical == "whoami" to _handle_whoami_command
- cli_commands_mixin.py: handler reports the local operator's tier
  (admin / unrestricted — the CLI runs on the operator's own machine,
  mirroring the gateway's unrestricted tier when no admin list is set)
- tests/cli/test_whoami_command.py: dispatch wiring + handler behavior

Refs NousResearch#74594
@alt-glitch alt-glitch added type/bug Something isn't working comp/cli CLI entry point, hermes_cli/, setup wizard P3 Low — cosmetic, nice to have duplicate This issue or pull request already exists labels Aug 3, 2026
@alt-glitch

Copy link
Copy Markdown
Contributor

This was generated by AI during triage.

Duplicate of #26047: both wire /whoami into the classic CLI dispatcher and add the same regression coverage. #40052 remains the alternative gateway-only policy.

@MumuTW

MumuTW commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the triage — the duplicate label is fair at the fix-intent level: this wires /whoami into the classic-CLI dispatcher with regression coverage, same as #26047.

One practical wrinkle: #26047 is stale relative to current main. Opened 2026-05-15 with a single commit, and the 07-13 hermes-sweeper review asked for the handler to move from cli.py into hermes_cli/cli_commands_mixin.py (post-0904bc7e organization, beside _handle_profile_command). That feedback has been unaddressed for three weeks with no author activity.

This PR already implements exactly that requested shape: the canonical == "whoami" dispatch branch in cli.py, _handle_whoami_command() in the mixin next to the /profile handler (mirroring the gateway's surface/profile/tier output; CLI operator = local admin), and dedicated runtime tests in tests/cli/test_whoami_command.py asserting no "Unknown command" fall-through.

Since #26047's branch predates the mixin refactor and is effectively unmaintained, I'd suggest treating this PR as the living implementation of the same fix and marking #26047 superseded — otherwise #74594 stays open pending a PR that doesn't conform to current main. Either way, note that #74595's KNOWN_MISSING_DISPATCH entry for whoami should be dropped once whichever dispatch PR lands. #40052 remains the orthogonal hide-vs-dispatch product question.

@teknium1

Copy link
Copy Markdown
Collaborator

Fixed on main via PR #90381 (salvage of #26047, the earliest submission for this bug). Thanks for the contribution!

@teknium1 teknium1 closed this Aug 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard duplicate This issue or pull request already exists P3 Low — cosmetic, nice to have type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Registered slash commands can silently have no CLI dispatch branch (/whoami, /indicator)

3 participants