diff --git a/agent-node/agent_node/skills/manager.py b/agent-node/agent_node/skills/manager.py index b232229..157fd40 100644 --- a/agent-node/agent_node/skills/manager.py +++ b/agent-node/agent_node/skills/manager.py @@ -17,16 +17,33 @@ def _discover_skills(self, sync_mgr): """Scans the skills/ directory for logic.py and loads skill implementations.""" - # Find project root (assumes /app/agent_node/skills/manager.py) - # We need to go up from agent_node/skills/manager.py to /app/ - project_root = os.path.abspath(os.path.join(os.path.dirname(__file__), "../../")) - skills_dir = os.path.join(project_root, "skills") + # Find candidate locations for skills + # 1. Monorepo root (../../../skills from this file) + # 2. Agent-node local (../../skills from this file) + # 3. Docker standard (/app/skills) + candidates = [ + os.path.abspath(os.path.join(os.path.dirname(__file__), "../../../skills")), + os.path.abspath(os.path.join(os.path.dirname(__file__), "../../skills")), + "/app/skills" + ] + + skills_dir = None + for cand in candidates: + if os.path.exists(cand) and os.path.isdir(cand): + # Ensure it's not a broken symlink and has actual content + try: + if any(os.path.isdir(os.path.join(cand, d)) for d in os.listdir(cand)): + skills_dir = cand + break + except OSError: + continue discovered = {} - if not os.path.exists(skills_dir): - print(f" [๐Ÿ”งโš ๏ธ] Skills directory not found: {skills_dir}") + if not skills_dir: + print(f" [๐Ÿ”งโš ๏ธ] Skills directory not found in candidate locations: {candidates}") return discovered + print(f" [๐Ÿ”ง] Using skills directory: {skills_dir}") for skill_dir in os.listdir(skills_dir): item_path = os.path.join(skills_dir, skill_dir) if os.path.isdir(item_path):