Skip to content

feat: config-gated /verbose command for messaging gateway#3262

Merged
teknium1 merged 2 commits intomainfrom
hermes/hermes-140430f8
Mar 26, 2026
Merged

feat: config-gated /verbose command for messaging gateway#3262
teknium1 merged 2 commits intomainfrom
hermes/hermes-140430f8

Conversation

@teknium1
Copy link
Copy Markdown
Contributor

Summary

Adds a gateway_config_gate field to CommandDef that lets cli_only commands be conditionally available in the messaging gateway, controlled by a config value. The first use is /verbose — now available in Telegram/Discord/Slack/etc. when the user opts in.

How it works

CommandDef gains a new optional field:

gateway_config_gate: str | None = None  # config dotpath; when truthy, overrides cli_only

The /verbose command uses it:

CommandDef("verbose", ..., cli_only=True, gateway_config_gate="display.tool_progress_command")

Default: off (existing behavior preserved — /verbose is CLI-only).

To enable: add to config.yaml:

display:
  tool_progress_command: true

Once enabled, /verbose in messaging platforms cycles the tool progress mode through off → new → all → verbose, saving to config.yaml (takes effect on the next message). Same cycle as the CLI.

Architecture

  • GATEWAY_KNOWN_COMMANDS always includes config-gated commands so the gateway recognizes them as commands (not regular messages) and can respond with "not enabled" when the gate is off
  • gateway_help_lines(), telegram_bot_commands(), slack_subcommand_map() dynamically check config to show/hide the command
  • _resolve_config_gates() + _is_gateway_available() helpers in commands.py handle the config lookup
  • The mechanism is generic — any future cli_only command can be config-gated the same way

Files changed

File Change
hermes_cli/commands.py gateway_config_gate field, updated gateway helpers
hermes_cli/config.py display.tool_progress_command: false default
gateway/run.py _handle_verbose_command handler + dispatch
tests/hermes_cli/test_commands.py Updated cli_only tests, 8 new config-gate tests
tests/gateway/test_verbose_command.py New test file for gateway handler

Test plan

  • 6241 passed, 200 skipped (1 pre-existing failure in test_anthropic_error_handling)
  • New tests cover: gate on/off for help, telegram, slack; cycling all four modes; YAML bool coercion; missing config file
Add gateway_config_gate field to CommandDef, allowing cli_only commands
to be conditionally available in the gateway based on a config value.

- CommandDef gains gateway_config_gate: str | None — a config dotpath
  that, when truthy, overrides cli_only for gateway surfaces
- /verbose uses gateway_config_gate='display.tool_progress_command'
- Default is off (cli_only behavior preserved)
- When enabled, /verbose cycles tool_progress mode (off/new/all/verbose)
  in the gateway, saving to config.yaml — same cycle as the CLI
- Gateway helpers (help, telegram menus, slack mapping) dynamically
  check config to include/exclude config-gated commands
- GATEWAY_KNOWN_COMMANDS always includes config-gated commands so
  the gateway recognizes them and can respond appropriately
- Handles YAML 1.1 bool coercion (bare 'off' parses as False)
- 8 new tests for the config gate mechanism + gateway handler
- AGENTS.md: add gateway_config_gate to CommandDef fields
- slash-commands.md: note /verbose can be enabled for messaging, update Notes
- configuration.md: add tool_progress_command to display section + usage note
- cli.md: cross-link to config docs for messaging enablement
- messaging/index.md: show tool_progress_command in config snippet
- plugins.md: add gateway_config_gate to register_command parameter table
@teknium1 teknium1 merged commit 72250b5 into main Mar 26, 2026
4 of 5 checks passed
StreamOfRon pushed a commit to StreamOfRon/hermes-agent that referenced this pull request Mar 29, 2026
…ch#3262)

* feat: config-gated /verbose command for messaging gateway

Add gateway_config_gate field to CommandDef, allowing cli_only commands
to be conditionally available in the gateway based on a config value.

- CommandDef gains gateway_config_gate: str | None — a config dotpath
  that, when truthy, overrides cli_only for gateway surfaces
- /verbose uses gateway_config_gate='display.tool_progress_command'
- Default is off (cli_only behavior preserved)
- When enabled, /verbose cycles tool_progress mode (off/new/all/verbose)
  in the gateway, saving to config.yaml — same cycle as the CLI
- Gateway helpers (help, telegram menus, slack mapping) dynamically
  check config to include/exclude config-gated commands
- GATEWAY_KNOWN_COMMANDS always includes config-gated commands so
  the gateway recognizes them and can respond appropriately
- Handles YAML 1.1 bool coercion (bare 'off' parses as False)
- 8 new tests for the config gate mechanism + gateway handler

* docs: document gateway_config_gate and /verbose messaging support

- AGENTS.md: add gateway_config_gate to CommandDef fields
- slash-commands.md: note /verbose can be enabled for messaging, update Notes
- configuration.md: add tool_progress_command to display section + usage note
- cli.md: cross-link to config docs for messaging enablement
- messaging/index.md: show tool_progress_command in config snippet
- plugins.md: add gateway_config_gate to register_command parameter table
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant