Skip to content

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

@clayht12-code

Description

@clayht12-code

Bug Description

The --clone-all flag for isolated agent creation seems to be copying the source profile directory into a subdirectory of itself (e.g., ra/profiles/ra), creating an infinitely recursive duplicate that consumes all available disk space. The destination path should be a sibling location (e.g., ra-clone) instead of a child of the source. This is likely a path construction issue where the clone destination is being resolved relative to the source directory rather than at the same level.

Steps to Reproduce

  1. create a new agent from your existing hermes baseline agent with the --clone-all flag
  2. my specific command was "hermes profile create ra --clone-all"

Expected Behavior

it should have merely copied the config to the new profile.

Actual Behavior

The clone feature's destination path is resolved as a child of the source profile directory instead of a sibling, causing shutil.copytree to recursively copy the profile into itself. This creates infinite nesting (profile/profiles/profile/profiles/...) that consumes all disk space until paths exceed macOS's PATH_MAX limit, at which point it crashes with "No such file or directory." The fix is to resolve the destination path relative to the parent profiles/ directory, not the source profile itself.

Affected Component

Configuration (config.yaml, .env, hermes setup)

Messaging Platform (if gateway-related)

No response

Operating System

Mac OS 26.2

Python Version

3.11.14

Hermes Version

0.6.0

Relevant Logs / Traceback

Root Cause Analysis (optional)

No response

Proposed Fix (optional)

No response

Are you willing to submit a PR for this?

  • I'd like to fix this myself and submit a PR

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions