Skip to content

feat: support configurable Telegram command menu - #43162

Open
cortanapham wants to merge 1 commit into
NousResearch:mainfrom
cortanapham:feat/telegram-menu-config-pinning
Open

feat: support configurable Telegram command menu#43162
cortanapham wants to merge 1 commit into
NousResearch:mainfrom
cortanapham:feat/telegram-menu-config-pinning

Conversation

@cortanapham

Copy link
Copy Markdown

PR Draft: Configurable Telegram command menu pinning/hiding

Title

feat: support configurable Telegram command menu

Summary

  • adds profile-local Telegram BotCommand menu customization through gateway.telegram_pinned_commands and gateway.telegram_hidden_commands
  • supports both YAML list values and numeric-string-keyed maps produced by hermes config set gateway.telegram_pinned_commands.0 ...
  • promotes pinned built-in/skill/plugin commands before the Telegram menu cap is applied
  • keeps dispatch canonical; hiding affects BotCommand visibility only, not manual command execution

Why

Telegram's visible BotCommand menu is capped. Profiles can have valid slash commands that dispatch correctly but are omitted from the visible menu because lower-priority commands filled the cap first. Users running multiple Hermes profiles need profile-local command visibility without hardcoding profile-specific preferences into shared source.

Tests

venv/bin/python -m pytest tests/hermes_cli/test_commands.py -q -o 'addopts='
146 passed, 1 warning in 3.41s

Local verification

~/.hermes/bin/samus_post_update_verify.py --skip-doctor
PASS

Notes

This PR intentionally does not add Samus/Kim-specific commands to the global registry. It provides a generic config surface that profiles can use independently.

@alt-glitch alt-glitch added type/feature New feature or request P3 Low — cosmetic, nice to have comp/cli CLI entry point, hermes_cli/, setup wizard platform/telegram Telegram bot adapter duplicate This issue or pull request already exists labels Jun 10, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

This was generated by AI during triage.

Duplicate of #42021 — same goal (work around Telegram's BotCommand menu cap so plugin/skill commands stay visible). #42021 offers the more comprehensive configurable surface (cap + prepend/append/replace + priority list). Also competes with #31099 and builds on merged #29585. Marking as duplicate of the most comprehensive open PR; maintainer to choose.

@teknium1 teknium1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for targeting the real remaining gap: current main’s configurable priority can promote built-in/plugin entries, but it does not elevate skills collected after the cap calculation (hermes_cli/commands.py:911-926).

Problems

  • The new resolver reads gateway.telegram_pinned_commands / gateway.telegram_hidden_commands (hermes_cli/commands.py:460-464 in this PR). Current Hermes documents and reads platforms.telegram.extra.command_menu (hermes_cli/commands.py:600-614; website/docs/user-guide/messaging/telegram.md:82-105), so this would introduce a second, undocumented config contract.
  • The PR does not update the configuration example or Telegram documentation for its new user-facing keys.

Suggested changes

  • Integrate pin/exclusion behavior into the existing platforms.telegram.extra.command_menu parser and order all eligible candidates before applying the cap, so a pinned skill can survive it.
  • Preserve the current sanitization, collision filtering, disabled-skill filtering, and registration path (plugins/platforms/telegram/adapter.py:2944-2946), and add canonical-path tests plus docs/example updates.

Automated hermes-sweeper review.

Comment thread hermes_cli/commands.py
cfg = read_raw_config()
except Exception:
cfg = {}
gateway = cfg.get("gateway") if isinstance(cfg, dict) else None

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please extend the established platforms.telegram.extra.command_menu configuration instead of introducing gateway.telegram_*. Current main reads and documents that canonical path in hermes_cli/commands.py:600-614 and website/docs/user-guide/messaging/telegram.md:82-105; a second namespace would be undocumented and inconsistent.

@teknium1 teknium1 added sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform labels Jul 14, 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 platform/telegram Telegram bot adapter sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants