修改skill目录
This commit is contained in:
parent
1535014c3e
commit
990f50ed55
@ -25,6 +25,7 @@ Skill 系统支持两种来源:官方 skills (`./skills/`) 和用户 skills (`
|
||||
|
||||
## Gotchas(开发必读)
|
||||
|
||||
- ⚠️ `create_robot_project` 的 autoload 去重是“包含匹配”,只要传入的 skill 字符串里包含 autoload skill 名,就不会重复自动加载
|
||||
- ⚠️ `_extract_skills_to_robot` 只会从 `skills/{SKILLS_SUBDIR}` 读取官方 skills,默认是 `common`
|
||||
- ⚠️ 执行脚本必须使用绝对路径
|
||||
- ⚠️ MCP 配置优先级:Skill MCP > 默认 MCP > 用户参数
|
||||
|
||||
@ -322,7 +322,6 @@ def create_robot_project(dataset_ids: List[str], bot_id: str, force_rebuild: boo
|
||||
"""
|
||||
|
||||
skills = list(skills or [])
|
||||
existing_skill_names = {Path(skill.lstrip("@")).name for skill in skills}
|
||||
if os.path.isabs(settings.SKILLS_DIR):
|
||||
autoload_skills_dir = Path(settings.SKILLS_DIR) / "autoload" / settings.SKILLS_SUBDIR
|
||||
else:
|
||||
@ -330,11 +329,10 @@ def create_robot_project(dataset_ids: List[str], bot_id: str, force_rebuild: boo
|
||||
|
||||
if autoload_skills_dir.exists():
|
||||
for item in sorted(autoload_skills_dir.iterdir()):
|
||||
if not item.is_dir() or item.name in existing_skill_names:
|
||||
if not item.is_dir() or any(re.search(re.escape(item.name), skill) for skill in skills):
|
||||
continue
|
||||
skill_path = f"@skills/autoload/{settings.SKILLS_SUBDIR}/{item.name}"
|
||||
skills.append(skill_path)
|
||||
existing_skill_names.add(item.name)
|
||||
logger.info(f"Auto loaded skill '{skill_path}' from {autoload_skills_dir}")
|
||||
else:
|
||||
logger.warning(f"Autoload skills directory does not exist: {autoload_skills_dir}")
|
||||
|
||||
Loading…
Reference in New Issue
Block a user