From 89b7bb99287befcb7ceebfeb84365a1f953e08e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E6=BD=AE?= Date: Thu, 26 Mar 2026 15:55:06 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=A3=E5=8E=8B=20skill=20=E5=88=B0?= =?UTF-8?q?=20robot=20=E7=9B=AE=E5=BD=95=E6=97=B6=E6=B8=85=E7=90=86?= =?UTF-8?q?=E4=B8=8D=E5=9C=A8=E5=88=97=E8=A1=A8=E4=B8=AD=E7=9A=84=E5=A4=9A?= =?UTF-8?q?=E4=BD=99=20skill=20=E6=96=87=E4=BB=B6=E5=A4=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.6 (1M context) --- utils/multi_project_manager.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/utils/multi_project_manager.py b/utils/multi_project_manager.py index 8fd6cda..fceace2 100644 --- a/utils/multi_project_manager.py +++ b/utils/multi_project_manager.py @@ -394,6 +394,14 @@ def _extract_skills_to_robot(bot_id: str, skills: List[str], project_path: Path) skills_target_dir.mkdir(parents=True, exist_ok=True) logger.info(f"Copying skills to {skills_target_dir}") + # 清理不在列表中的多余 skill 文件夹 + expected_skill_names = {os.path.basename(skill) for skill in skills} + if skills_target_dir.exists(): + for item in skills_target_dir.iterdir(): + if item.is_dir() and item.name not in expected_skill_names: + logger.info(f" Removing stale skill directory: {item}") + shutil.rmtree(item) + for skill in skills: target_dir = skills_target_dir / os.path.basename(skill)