diff --git a/hermes_cli/commands.py b/hermes_cli/commands.py index 1478b8b2e44..f071b2acac4 100644 --- a/hermes_cli/commands.py +++ b/hermes_cli/commands.py @@ -468,20 +468,23 @@ def telegram_bot_commands() -> list[tuple[str, str]]: Telegram command names cannot contain hyphens, so they are replaced with underscores. Aliases are skipped -- Telegram shows one menu entry per - canonical command. Commands that require arguments are skipped because - selecting a Telegram BotCommand sends only ``/command`` and would execute - an incomplete command. + canonical command. - Plugin-registered slash commands are included so plugins get native - autocomplete in Telegram without touching core code. + Built-in commands that require arguments (e.g. /queue, /steer, /background) + are **included** because their handlers return usage text when selected + without a payload, making them discoverable via autocomplete. + + Plugin-registered slash commands that require arguments are **excluded** + because plugins may not provide a no-arg usage fallback. """ overrides = _resolve_config_gates() result: list[tuple[str, str]] = [] for cmd in COMMAND_REGISTRY: if not _is_gateway_available(cmd, overrides): continue - if _requires_argument(cmd.args_hint): - continue + # Built-in arg-taking commands are included — their handlers show + # usage text when invoked without arguments, and hiding them from + # the menu hurts discoverability (issue #24312). tg_name = _sanitize_telegram_name(cmd.name) if tg_name: result.append((tg_name, cmd.description)) diff --git a/tests/hermes_cli/test_commands.py b/tests/hermes_cli/test_commands.py index ad4c7d5c638..d08f886fa6a 100644 --- a/tests/hermes_cli/test_commands.py +++ b/tests/hermes_cli/test_commands.py @@ -242,12 +242,14 @@ class TestTelegramBotCommands: tg_name = cmd.name.replace("-", "_") assert tg_name not in names - def test_excludes_commands_with_required_args(self): + def test_includes_builtin_commands_with_required_args(self): + """Built-in arg-taking commands (e.g. /queue, /steer, /background) + are now included because their handlers return usage text when + invoked without arguments — issue #24312.""" names = {name for name, _ in telegram_bot_commands()} - assert "background" not in names - assert "queue" not in names - assert "steer" not in names - assert "background" in GATEWAY_KNOWN_COMMANDS + assert "background" in names + assert "queue" in names + assert "steer" in names class TestSlackSubcommandMap: