diff --git a/gateway/platforms/telegram.py b/gateway/platforms/telegram.py index ac3efd92f6..db1b19431c 100644 --- a/gateway/platforms/telegram.py +++ b/gateway/platforms/telegram.py @@ -623,9 +623,10 @@ class TelegramAdapter(BasePlatformAdapter): try: from telegram import BotCommand from hermes_cli.commands import telegram_menu_commands - # 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) + # Telegram allows up to 100 commands but has an undocumented + # payload size limit. Skill descriptions are truncated to 40 + # chars in telegram_menu_commands() to fit 100 commands safely. + menu_commands, hidden_count = telegram_menu_commands(max_commands=100) await self._bot.set_my_commands([ BotCommand(name, desc) for name, desc in menu_commands ]) diff --git a/hermes_cli/commands.py b/hermes_cli/commands.py index f043ec73fa..a14432624d 100644 --- a/hermes_cli/commands.py +++ b/hermes_cli/commands.py @@ -399,9 +399,10 @@ def telegram_menu_commands(max_commands: int = 100) -> tuple[list[tuple[str, str continue # hub-installed, not built-in name = cmd_key.lstrip("/").replace("-", "_") desc = info.get("description", "") - # Telegram descriptions max 256 chars - if len(desc) > 256: - desc = desc[:253] + "..." + # Keep descriptions short — setMyCommands has an undocumented + # total payload limit. 40 chars fits 100 commands safely. + if len(desc) > 40: + desc = desc[:37] + "..." all_commands.append((name, desc)) except Exception: pass