fix(cli): dispatch /indicator to set the busy-indicator style (#50618) - #51178
fix(cli): dispatch /indicator to set the busy-indicator style (#50618)#51178dongjiang1989 wants to merge 1 commit into
Conversation
Duplicate of #41869 — the |
|
Thanks @alt-glitch Based on PR #41869, the following modifications were made: Changes
Added the elif canonical == "indicator":
self._handle_indicator_command(cmd_original)
Added the
Created a comprehensive test file including:
|
tonydwb
left a comment
There was a problem hiding this comment.
Code Review Summary
Verdict: Approved
Adds /indicator command dispatch to set the busy-indicator style (3 files, 189 additions). Well-scoped feature addition with clear CLI interaction. No security concerns.
Reviewed by Hermes Agent
teknium1
left a comment
There was a problem hiding this comment.
Thanks for tracing the advertised command through the classic CLI path. The premise is confirmed on current main: /indicator is registered at hermes_cli/commands.py:163 and documented at website/docs/reference/slash-commands.md:82, but cli.py:8917-8921 dispatches /voice and /busy then falls through without an indicator case.
Problems
hermes_cli/cli_commands_mixin.py:2398introduces another independent style list alongsidetui_gateway/server.py:1896andhermes_cli/commands.py:163. A later style addition can drift so that the TUI accepts it while the classic CLI rejects it.tests/cli/test_indicator_command.py:140-142snapshots the current four-value catalog rather than checking that the handler accepts every registered subcommand.
Suggested changes
- Share the Python style list between the CLI handler and TUI gateway, and test handler behavior for the registry's subcommands.
This is an automated hermes-sweeper review.
f485b55 to
a4e5498
Compare
bb4d2b3 to
f85d8bd
Compare
Thanks @teknium1 |
f85d8bd to
bf7f40d
Compare
…search#50618) The /indicator command was registered in COMMAND_REGISTRY, listed in /help, offered by tab-completion, recommended by the tips system, and even documented in config.py — but it had no actual handler. Running /indicator in the CLI produced "Unknown command: indicator". Add _handle_indicator_command to CLICommandsMixin that: - Shows the current indicator style when called with no args or "status" - Validates the requested style against the shared INDICATOR_STYLES allowlist (ascii | emoji | kaomoji | unicode) - Persists the choice to display.tui_status_indicator in config.yaml via the existing save_config_value helper - Falls back to session-only when config save fails The indicator-style allowlist is defined once in hermes_constants as INDICATOR_STYLES + DEFAULT_INDICATOR_STYLE and imported by all three consumers (CLI handler, command registry, TUI gateway config handler), preventing drift between the TUI and CLI validation. Also adds tests/cli/test_indicator_command.py covering dispatch, validation, persistence, and registry integration. Signed-off-by: dongjiang <dongjiang1989@126.com>
bf7f40d to
c0c5453
Compare
|
Merged via #75874 — your commit(s) were cherry-picked onto current main with your authorship preserved in git history (rebase merge). Thanks for the contribution! |
Summary
Closes: #50618
The
/indicatorcommand was registered inCOMMAND_REGISTRY, listed in/help, offered by tab-completion, recommended by the tips system, and even documented inconfig.py("Live-swappable via/indicator <style>")— but
process_commandhad no branch for it. Typing/indicator(or/indicator emoji) fell through to the prefix matcher and printed "Unknown command: /indicator", leaving no CLI way to changedisplay.tui_status_indicatorshort of hand-editingconfig.yaml.The styles feature (#17150) shipped the registry entry, config key, tip, and TUI/JSON-RPC wiring, but never added the CLI handler. This adds it.
What does this PR do?
Wires the advertised
/indicatorslash command to a real handler so it sets the TUI busy-indicator style from the CLI./indicator(or/indicator status) shows the current style;/indicator <kaomoji|emoji|unicode|ascii>validates the choice and persists it todisplay.tui_status_indicator— the same key the TUI reads — so the next render picks it up. Unknown styles print usage and change nothing.Related Issue
Fixes #50618
Type of Change
Changes Made
cli.pyelif canonical == "indicator"dispatch branch inprocess_command, so the command resolves and the REPL stays alive.hermes_cli/cli_commands_mixin.py_handle_indicator_command(status view, style validation, persistence viasave_config_value("display.tui_status_indicator", ...)with in-memory mirror), modeled on_handle_busy_command.tests/cli/test_indicator_command.pyHow to Test
scripts/run_tests.sh tests/cli/test_indicator_command.py— 8 tests pass./indicator emoji— prints a saved-to-config confirmation (previously printed "Unknown command: /indicator")./indicator— shows the current style;/indicator rainbow— prints usage and leaves the stored value untouched.Checklist
Code
Documentation & Housekeeping
cli-config.yaml.exampleif I added/changed config keys — N/A (key already existed)CONTRIBUTING.mdorAGENTS.mdif I changed architecture — N/A