Skip to content

Commit 8cc3409

Browse files
committed
fix(skill-commands): restore platform resolver after rebase
1 parent 53ec6e7 commit 8cc3409

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

agent/skill_commands.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,20 @@
2525
# Patterns for sanitizing skill names into clean hyphen-separated slugs.
2626
_SKILL_INVALID_CHARS = re.compile(r"[^a-z0-9-]")
2727
_SKILL_MULTI_HYPHEN = re.compile(r"-{2,}")
28+
29+
30+
def _resolve_skill_commands_platform() -> Optional[str]:
31+
"""Return the current platform scope used for disabled-skill filtering."""
32+
try:
33+
from gateway.session_context import get_session_env
34+
35+
resolved_platform = (
36+
os.getenv("HERMES_PLATFORM")
37+
or get_session_env("HERMES_SESSION_PLATFORM")
38+
)
39+
except Exception:
40+
resolved_platform = os.getenv("HERMES_PLATFORM")
41+
return resolved_platform or None
2842
def _load_skill_payload(skill_identifier: str, task_id: str | None = None) -> tuple[dict[str, Any], Path | None, str] | None:
2943
"""Load a skill by name/path and return (loaded_payload, skill_dir, display_name)."""
3044
raw_identifier = (skill_identifier or "").strip()

0 commit comments

Comments
 (0)