Skip to content

fix(profile): prevent recursive clone-all copies#6163

Closed
iacker wants to merge 1 commit into
NousResearch:mainfrom
iacker:fix/profile-clone-all-recursion
Closed

fix(profile): prevent recursive clone-all copies#6163
iacker wants to merge 1 commit into
NousResearch:mainfrom
iacker:fix/profile-clone-all-recursion

Conversation

@iacker

@iacker iacker commented Apr 8, 2026

Copy link
Copy Markdown
Contributor

Summary

  • prevent hermes profile create --clone-all from recursively copying the profiles/ directory when cloning from the default profile
  • detect when the destination lives inside the source tree and exclude nested profiles from the copy
  • add a regression test covering clone-all from the default ~/.hermes profile

Testing

  • source venv/bin/activate && python -m pytest tests/hermes_cli/test_profiles.py -q

Closes #4306

@iacker

iacker commented Apr 8, 2026

Copy link
Copy Markdown
Contributor Author

Friendly ping — this one fixes a reproducible profile-creation bug where hermes profile create --clone-all can recursively copy profiles/ into itself when cloning from the default ~/.hermes profile. The patch is narrow and includes a regression test (tests/hermes_cli/test_profiles.py). Happy to adjust quickly if you want a different guard condition or test shape.

@iacker

iacker commented Apr 21, 2026

Copy link
Copy Markdown
Contributor Author

This fixes a real bug: hermes profile create --clone-all copies profiles/ into itself recursively when the source is ~/.hermes. Includes a regression test. Ready for review.

@alt-glitch alt-glitch added type/bug Something isn't working comp/cli CLI entry point, hermes_cli/, setup wizard labels Apr 21, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Related to #11829 and #4312 — all address the same clone-all recursion bug via different approaches.

@teknium1

Copy link
Copy Markdown
Contributor

Thanks for the fix @iacker — this same bug (#4306) was fixed independently in commit 528e7dc on April 21 (PR by @hejuntt1014), which is already on main. Both fixes use the same approach: pass a copytree ignore callable that excludes the sibling profiles/ directory at the source root, plus a regression test. Closing as superseded. Appreciate you taking the time to dig into this one.

@teknium1 teknium1 closed this May 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: --clone-all flag creates an infinitely recursive duplicate w/in the profiles directory, takes up all available disk space.

3 participants