mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-01 01:51:44 +00:00
fix(cli): exclude profiles/ from profile create --clone-all
shutil.copytree from default ~/.hermes duplicated ~/.hermes/profiles into the new profile, causing nested profiles/.../profiles/... and huge disk use. Match export behavior (_DEFAULT_EXPORT_EXCLUDE_ROOT) by ignoring the sibling profiles tree at the source root. Made-with: Cursor
This commit is contained in:
parent
4899bd99c0
commit
528e7dc176
2 changed files with 46 additions and 2 deletions
|
|
@ -171,6 +171,23 @@ class TestCreateProfile:
|
|||
assert not (profile_dir / "gateway_state.json").exists()
|
||||
assert not (profile_dir / "processes.json").exists()
|
||||
|
||||
def test_clone_all_excludes_sibling_profiles_tree(self, profile_env):
|
||||
"""--clone-all from default ~/.hermes must not copy profiles/* (nested explosion)."""
|
||||
tmp_path = profile_env
|
||||
default_home = tmp_path / ".hermes"
|
||||
profiles_root = default_home / "profiles"
|
||||
profiles_root.mkdir(exist_ok=True)
|
||||
(profiles_root / "other").mkdir(parents=True, exist_ok=True)
|
||||
(profiles_root / "other" / "marker.txt").write_text("sibling data")
|
||||
|
||||
(default_home / "memories").mkdir(exist_ok=True)
|
||||
(default_home / "memories" / "note.md").write_text("remember this")
|
||||
|
||||
profile_dir = create_profile("coder", clone_all=True, no_alias=True)
|
||||
|
||||
assert (profile_dir / "memories" / "note.md").read_text() == "remember this"
|
||||
assert not (profile_dir / "profiles").exists()
|
||||
|
||||
def test_clone_config_missing_files_skipped(self, profile_env):
|
||||
"""Clone config gracefully skips files that don't exist in source."""
|
||||
profile_dir = create_profile("coder", clone_config=True, no_alias=True)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue