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 <name> --clone-all' (#11560). Export paths were
covered by the salvaged #58397/#58445 commits; this carries the clone
half of open PR #11573.

Fixes #11560
This commit is contained in:
Matt Van Horn 2026-07-04 14:10:27 -07:00 committed by Teknium
parent 8d9684c9da
commit b7192b1cb0

View file

@ -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: