fix(gateway): prioritize Telegram command menu

This commit is contained in:
helix4u 2026-05-20 15:28:01 -06:00 committed by Teknium
parent 1566d71726
commit b9b6e034d5
2 changed files with 86 additions and 3 deletions

View file

@ -951,6 +951,30 @@ class TestTelegramMenuCommands:
f"Command '{name}' is {len(name)} chars (limit {_TG_NAME_LIMIT})"
)
def test_operational_builtins_survive_thirty_command_cap(self, tmp_path, monkeypatch):
(tmp_path / "config.yaml").write_text(
"display:\n tool_progress_command: true\n"
)
monkeypatch.setenv("HERMES_HOME", str(tmp_path))
menu, hidden = telegram_menu_commands(max_commands=30)
names = [name for name, _desc in menu]
assert len(names) == 30
assert hidden > 0
for name in (
"debug",
"restart",
"update",
"verbose",
"commands",
"help",
"new",
"stop",
"status",
):
assert name in names
def test_includes_plugin_commands_via_lazy_discovery(self, tmp_path, monkeypatch):
"""Telegram menu generation should discover plugin slash commands on first access."""
from unittest.mock import patch