fix: filter platform-disabled skills from <available_skills> prompt (#46201)
build_skills_system_prompt() already resolved _platform_hint but called get_disabled_skill_names() with no argument, so the resolved platform never reached the filter and the prompt cache_key varied by platform while the disabled set did not. Pass _platform_hint or None. get_disabled_skill_names() also fully ignored the global 'disabled' list once a platform-specific list was found. Return the union (global | platform) so a globally-disabled skill stays disabled on every platform. Salvaged from #46203 by @iborazzi; the unrelated apps/shared/tsconfig.json ES2023 bump is intentionally dropped (one concern per PR).
This commit is contained in:
committed by
kshitijk4poor
parent
7433d5f0eb
commit
7bbe7024c2
@@ -305,13 +305,14 @@ def get_disabled_skill_names(platform: str | None = None) -> Set[str]:
|
||||
or os.getenv("HERMES_PLATFORM")
|
||||
or get_session_env("HERMES_SESSION_PLATFORM")
|
||||
)
|
||||
global_disabled = _normalize_string_set(skills_cfg.get("disabled"))
|
||||
if resolved_platform:
|
||||
platform_disabled = (skills_cfg.get("platform_disabled") or {}).get(
|
||||
resolved_platform
|
||||
)
|
||||
if platform_disabled is not None:
|
||||
return _normalize_string_set(platform_disabled)
|
||||
return _normalize_string_set(skills_cfg.get("disabled"))
|
||||
return global_disabled | _normalize_string_set(platform_disabled)
|
||||
return global_disabled
|
||||
|
||||
|
||||
def _normalize_string_set(values) -> Set[str]:
|
||||
|
||||
Reference in New Issue
Block a user