Skip to content

fix(profiles): pass symlinks=True to copytree to prevent RecursionError#11829

Open
Mibayy wants to merge 2 commits into
NousResearch:mainfrom
Mibayy:fix/profile-clone-symlink-recursion
Open

fix(profiles): pass symlinks=True to copytree to prevent RecursionError#11829
Mibayy wants to merge 2 commits into
NousResearch:mainfrom
Mibayy:fix/profile-clone-symlink-recursion

Conversation

@Mibayy

@Mibayy Mibayy commented Apr 17, 2026

Copy link
Copy Markdown
Contributor

Summary

hermes profile create <name> --clone-all raises RecursionError when the profile directory contains a symlink pointing to a parent directory. shutil.copytree follows symlinks by default, causing infinite recursion.

Changes

  • hermes_cli/profiles.py: add symlinks=True to the shutil.copytree call so symlinks are copied as symlinks rather than followed

Testing

Profile creation with a directory containing a circular symlink no longer crashes.

Closes #11560

Mibayy and others added 2 commits April 18, 2026 00:38
…onError (issue NousResearch#11560)

shutil.copytree() with the default symlinks=False follows symlinks and
can enter infinite recursion when the profile directory contains a
circular or self-referential symlink (e.g. a skill directory that links
back to a parent). Passing symlinks=True causes copytree to copy the
link itself rather than following it, preventing the RecursionError.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@Mibayy Mibayy force-pushed the fix/profile-clone-symlink-recursion branch from c8ea8b4 to 638fbdb Compare April 17, 2026 22:38
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/cli CLI entry point, hermes_cli/, setup wizard labels Apr 24, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Competing fix for #11560 — PR #11573 addresses the same issue with a broader scope (clone + export).

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 P2 Medium — degraded but workaround exists type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

hermes profile --clone-all crashes with RecursionError on recursive symlink

2 participants