mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-28 06:51:16 +08:00
_load_skill_payload() reconstructed skill_dir as SKILLS_DIR / relative_path, which is wrong for external skills from skills.external_dirs — they live outside SKILLS_DIR entirely. Scripts and linked files failed to load. Fix: skill_view() now includes the absolute skill_dir in its result dict. _load_skill_payload() uses that directly when available, falling back to the SKILLS_DIR-relative reconstruction only for legacy responses. Closes #10313
This commit is contained in:
@@ -72,7 +72,14 @@ def _load_skill_payload(skill_identifier: str, task_id: str | None = None) -> tu
|
||||
skill_name = str(loaded_skill.get("name") or normalized)
|
||||
skill_path = str(loaded_skill.get("path") or "")
|
||||
skill_dir = None
|
||||
if skill_path:
|
||||
# Prefer the absolute skill_dir returned by skill_view() — this is
|
||||
# correct for both local and external skills. Fall back to the old
|
||||
# SKILLS_DIR-relative reconstruction only when skill_dir is absent
|
||||
# (e.g. legacy skill_view responses).
|
||||
abs_skill_dir = loaded_skill.get("skill_dir")
|
||||
if abs_skill_dir:
|
||||
skill_dir = Path(abs_skill_dir)
|
||||
elif skill_path:
|
||||
try:
|
||||
skill_dir = SKILLS_DIR / Path(skill_path).parent
|
||||
except Exception:
|
||||
|
||||
Reference in New Issue
Block a user