fix(profile): lazy manifest-name import; --sync-imports notice under --clone-all too

`hermes_cli/profiles.py` imported SYNC_MANIFEST_NAME from agent_import_sync at
module top, which pulled yaml/utils into every startup that resolves a profile;
the import now happens only inside _bootstrap_profile_dir when --sync-imports
is used (verified: importing hermes_cli.profiles no longer loads
hermes_cli.agent_import_sync).

`profile create --clone-all --sync-imports` accepted the flag (a full copy
carries import-sync.json regardless) but printed no notice; the hint is now
printed for both --clone and --clone-all.
This commit is contained in:
teknium1
2026-09-14 21:28:34 -07:00
committed by Teknium
parent 7bb52c0b74
commit 5dc5a9f3f6
2 changed files with 4 additions and 4 deletions

View File

@@ -214,9 +214,9 @@ def _profile_create(args):
print(f"Full copy from {source_label} (excluding session history, cron jobs, backups, and snapshots).")
else:
print(f"Cloned config, .env, SOUL.md, and skills from {source_label}.")
if sync_imports:
print(f"Import sources carried over — `hermes -p {name} import-agent --sync` "
"keeps pulling the same Claude Code / Codex trees.")
if sync_imports:
print(f"Import sources carried over — `hermes -p {name} import-agent --sync` "
"keeps pulling the same Claude Code / Codex trees.")
_print_channel_clone_notice(name, source_label, clone_channels, "--clone-all" if clone_all else "--clone")
# Auto-clone Honcho config for the new profile (only with clone operations)
try:

View File

@@ -16,7 +16,6 @@ from pathlib import Path
from typing import Dict, List, Optional, Tuple
from agent.skill_utils import is_excluded_skill_path
from hermes_cli.agent_import_sync import SYNC_MANIFEST_NAME
from hermes_cli.archive_safe import archive_root_dirs, make_targz, normalize_archive_parts, safe_extract_targz
from hermes_constants import clear_named_profile_deleted, mark_named_profile_deleted, named_profile_is_deleted
@@ -887,6 +886,7 @@ def _bootstrap_profile_dir(profile_dir: Path, source_dir: Optional[Path],
for relpath in _CLONE_SUBDIR_FILES:
_clone_file(source_dir, profile_dir, relpath)
if sync_imports:
from hermes_cli.agent_import_sync import SYNC_MANIFEST_NAME # lazy: keeps yaml/utils off the hot startup path
_clone_file(source_dir, profile_dir, SYNC_MANIFEST_NAME)