From da3e22bcfa2c583204cbe0742a6b691d9b681da5 Mon Sep 17 00:00:00 2001 From: Teknium <127238744+teknium1@users.noreply.github.com> Date: Mon, 30 Mar 2026 11:05:20 -0700 Subject: [PATCH] =?UTF-8?q?fix:=20cap=20Telegram=20menu=20at=2050=20comman?= =?UTF-8?q?ds=20=E2=80=94=20API=20rejects=20above=20~60=20(#4006)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: use SKILLS_DIR not repo path for Telegram menu skill filter Skills are synced to ~/.hermes/skills/ (SKILLS_DIR), not the repo's skills/ directory. The previous filter compared against the repo path so no skills matched. Now checks SKILLS_DIR and excludes .hub/ subdirectory (user-installed hub skills). * fix: cap Telegram menu at 50 commands — API rejects above ~60 Telegram's setMyCommands returns BOT_COMMANDS_TOO_MUCH when registering close to 100 commands despite docs claiming 100 is the limit. Metadata overhead causes rejection above ~60. Cap at 50 for reliability — remaining commands accessible via /commands. --- gateway/platforms/telegram.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gateway/platforms/telegram.py b/gateway/platforms/telegram.py index 91223d7b7..ac3efd92f 100644 --- a/gateway/platforms/telegram.py +++ b/gateway/platforms/telegram.py @@ -623,7 +623,9 @@ class TelegramAdapter(BasePlatformAdapter): try: from telegram import BotCommand from hermes_cli.commands import telegram_menu_commands - menu_commands, hidden_count = telegram_menu_commands(max_commands=100) + # Telegram docs say 100, but setMyCommands returns + # BOT_COMMANDS_TOO_MUCH above ~60 due to metadata overhead. + menu_commands, hidden_count = telegram_menu_commands(max_commands=50) await self._bot.set_my_commands([ BotCommand(name, desc) for name, desc in menu_commands ])