From b7192b1cb0209b060ff1b3b84be3924dbb317cad Mon Sep 17 00:00:00 2001 From: Matt Van Horn <455140+mvanhorn@users.noreply.github.com> Date: Sat, 4 Jul 2026 14:10:27 -0700 Subject: [PATCH] fix(profiles): preserve symlinks in clone-all and skills clone paths Widens the symlinks=True fix to the create_profile clone sites so a symlink pointing at a parent directory can't recurse infinitely during 'hermes profile create --clone-all' (#11560). Export paths were covered by the salvaged #58397/#58445 commits; this carries the clone half of open PR #11573. Fixes #11560 --- hermes_cli/profiles.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hermes_cli/profiles.py b/hermes_cli/profiles.py index 73137fc7e3d..950c4ef4275 100644 --- a/hermes_cli/profiles.py +++ b/hermes_cli/profiles.py @@ -1061,6 +1061,7 @@ def create_profile( shutil.copytree( source_dir, profile_dir, + symlinks=True, ignore=_clone_all_copytree_ignore(source_dir), ) # Strip runtime files @@ -1095,7 +1096,7 @@ def create_profile( # same agent capabilities as the source profile. source_skills = source_dir / "skills" if source_skills.is_dir(): - shutil.copytree(source_skills, profile_dir / "skills", dirs_exist_ok=True) + shutil.copytree(source_skills, profile_dir / "skills", symlinks=True, dirs_exist_ok=True) # Clone memory and other subdirectory files for relpath in _CLONE_SUBDIR_FILES: