fix: respect per-platform disabled skills in Telegram menu and gateway dispatch (#4799)
Three interconnected bugs caused `hermes skills config` per-platform settings to be silently ignored: 1. telegram_menu_commands() never filtered disabled skills — all skills consumed menu slots regardless of platform config, hitting Telegram's 100 command cap. Now loads disabled skills for 'telegram' and excludes them from the menu. 2. Gateway skill dispatch executed disabled skills because get_skill_commands() (process-global cache) only filters by the global disabled list at scan time. Added per-platform check before execution, returning an actionable 'skill is disabled' message. 3. get_disabled_skill_names() only checked HERMES_PLATFORM env var, but the gateway sets HERMES_SESSION_PLATFORM instead. Added HERMES_SESSION_PLATFORM as fallback, plus an explicit platform= parameter for callers that know their platform (menu builder, gateway dispatch). Also added platform to prompt_builder's skills cache key so multi-platform gateways get correct per-platform skill prompts. Reported by SteveSkedasticity (CLAW community).
This commit is contained in:
@@ -2060,6 +2060,19 @@ class GatewayRunner:
|
||||
skill_cmds = get_skill_commands()
|
||||
cmd_key = f"/{command}"
|
||||
if cmd_key in skill_cmds:
|
||||
# Check per-platform disabled status before executing.
|
||||
# get_skill_commands() only applies the *global* disabled
|
||||
# list at scan time; per-platform overrides need checking
|
||||
# here because the cache is process-global across platforms.
|
||||
_skill_name = skill_cmds[cmd_key].get("name", "")
|
||||
_plat = source.platform.value if source.platform else None
|
||||
if _plat and _skill_name:
|
||||
from agent.skill_utils import get_disabled_skill_names as _get_plat_disabled
|
||||
if _skill_name in _get_plat_disabled(platform=_plat):
|
||||
return (
|
||||
f"The **{_skill_name}** skill is disabled for {_plat}.\n"
|
||||
f"Enable it with: `hermes skills config`"
|
||||
)
|
||||
user_instruction = event.get_command_args().strip()
|
||||
msg = build_skill_invocation_message(
|
||||
cmd_key, user_instruction, task_id=_quick_key
|
||||
|
||||
Reference in New Issue
Block a user