fix: preserve prioritized Telegram skill commands - #57938
Conversation
Duplicate of #55192 — same author, byte-for-byte identical |
teknium1
left a comment
There was a problem hiding this comment.
Thanks for the focused regression fix. The premise is confirmed on current main: hermes_cli/commands.py:917-927 limits skill collection before the combined menu can be priority-sorted, while configured priority is applied only to the core/plugin list at hermes_cli/commands.py:912.
Problems
hermes_cli/commands.py:897-903documents a fixed core → plugin → skill ordering, with core commands always included and only skills trimmed. After the new global priority sort, a configured-priority skill can precede and displace an unprioritized core command under the cap, so that contract is stale.
Suggested changes
- Update that docstring to describe priority application over the combined eligible command list before truncation, and the resulting meaning of
hidden_count.
Automated hermes-sweeper review.
| # Drop the cmd_key — Telegram only needs (name, desc) pairs. | ||
| all_commands.extend((n, d) for n, d, _k in entries) | ||
| return all_commands[:max_commands], hidden_count + hidden_core_count | ||
| all_commands = _prioritize_telegram_menu_commands(all_commands) |
There was a problem hiding this comment.
This new global priority pass means the function docstring above is no longer accurate: it currently promises core → plugin → skill ordering, always-included core commands, and skill-only trimming. Please update that contract to describe sorting the combined eligible list before enforcing the Telegram cap.
|
This is now fixed on main by #98280 (commit 3e6229e), which salvaged #82516 — the same priority-before-cap approach you pioneered here first (June 29, the earliest submission of this fix along with your #55192). Sorry we couldn't land your branch directly; the merged version extends the re-rank across core+plugin+skill tiers with a unified priority list. Crediting you here as the first submitter of the fix idea. Thanks @cortanapham! |
Summary
Why
platforms.telegram.extra.command_menu.prioritylets users pin important commands, but prioritized skill commands could still be dropped because Telegram skill entries were trimmed before the combined priority sort. This meant operational skill commands configured as high priority could disappear from the visible Telegram menu when built-in/core commands consumed the cap first.Tests
python -m pytest tests/hermes_cli/test_commands.py -k 'TelegramMenuCommands' -o 'addopts=' -q