Skip to content

fix(cli): wire /indicator slash command to a handler - #27627

Closed
luyao618 wants to merge 1 commit into
NousResearch:mainfrom
luyao618:fix/issue-27603-indicator-command-handler
Closed

fix(cli): wire /indicator slash command to a handler#27627
luyao618 wants to merge 1 commit into
NousResearch:mainfrom
luyao618:fix/issue-27603-indicator-command-handler

Conversation

@luyao618

Copy link
Copy Markdown
Contributor

Summary

Fixes #27603. The /indicator slash command was declared in hermes_cli/commands.py COMMAND_REGISTRY (with subcommands kaomoji|emoji|unicode|ascii) and shows up in autocomplete/help, but HermesCLI.process_command() in cli.py had no matching elif canonical == "indicator" branch. As a result, typing /indicator unicode fell through to the "Unknown command" path even though the command is documented and the underlying config key (display.tui_status_indicator) is fully supported by the TUI gateway and ui-tui consumers.

What changed

  • cli.py
    • process_command() now dispatches canonical == "indicator" to a new handler, placed next to the existing /skin and /busy handlers.
    • _handle_indicator_command() mirrors the style of _handle_busy_command():
      • /indicator or /indicator status → prints the current style (read from load_cli_config()display.tui_status_indicator, defaulting to kaomoji) and usage hint.
      • /indicator <kaomoji|emoji|unicode|ascii> → validates the arg, calls save_config_value("display.tui_status_indicator", arg), and prints a confirmation. Unknown args get a usage hint and no write.
  • tests/hermes_cli/test_indicator_command.py (new)
    • Asserts indicator is present in COMMAND_REGISTRY and resolves via resolve_command().
    • Asserts HermesCLI._handle_indicator_command exists and that process_command() source contains the dispatch branch (regression guard for the original bug).
    • Calls the handler directly with a valid style and asserts save_config_value is invoked with the right key/value.
    • Calls the handler with a bogus style and asserts nothing is persisted.

Verification

  • The display.tui_status_indicator config key already exists (hermes_cli/config.py:1006, default kaomoji) and is consumed by tui_gateway/server.py and ui-tui/src/app/useConfigSync.ts, so this change just exposes the existing knob via the slash command users were already trying to type.
  • The original issue body referenced display.busy_indicator_style; verified the real key in this repo is display.tui_status_indicator and used that.
  • pytest tests/hermes_cli/test_indicator_command.py -x -q4 passed.

Risk

Very low. Pure additive change:

  • New elif branch in command dispatch — does not affect other commands.
  • New method on HermesCLI.
  • New test file.

No changes to behavior of any other slash command or to the config-key semantics.

@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/cli CLI entry point, hermes_cli/, setup wizard labels May 17, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Fixes #27603 (duplicate of #22960). Note: competing PRs #22962, #23006, #22965, #23289 were all closed without merging for the same fix.

The /indicator command was declared in hermes_cli/commands.py
COMMAND_REGISTRY (with subcommands kaomoji/emoji/unicode/ascii)
but HermesCLI.process_command() had no matching elif branch, so
typing '/indicator unicode' produced 'Unknown command' even though
the command appeared in the help/autocomplete.

Add _handle_indicator_command modeled on _handle_busy_command:
- /indicator (or /indicator status) prints the current style
- /indicator <style> validates against {kaomoji, emoji, unicode,
  ascii} and persists display.tui_status_indicator via
  save_config_value
- unknown styles are rejected with a usage hint

Add tests/hermes_cli/test_indicator_command.py covering registry
presence, dispatch wiring, save-on-valid-style, and reject-on-bogus.

Fixes NousResearch#27603
@luyao618
luyao618 force-pushed the fix/issue-27603-indicator-command-handler branch from e050ce6 to 41a1460 Compare May 18, 2026 05:00
@luyao618

Copy link
Copy Markdown
Contributor Author

Closing — 4 prior PRs for the same #22960/#27603 fix (#22962, #23006, #22965, #23289) were all closed without merging, so this route clearly isn't being accepted. Not worth keeping another one open.

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 P2 Medium — degraded but workaround exists type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: /indicator slash command registered but has no handler implementation

2 participants