Skip to content

fix: honor HERMES_CONFIG/HERMES_HOME for multi-profile setups - #72

Closed
MasterCATZ wants to merge 1 commit into
AMAP-ML:mainfrom
MasterCATZ:fix/hermes-multi-profile-config
Closed

MasterCATZ wants to merge 1 commit into
AMAP-ML:mainfrom
MasterCATZ:fix/hermes-multi-profile-config

Conversation

@MasterCATZ

Copy link
Copy Markdown

Problem

SkillClaw hardcodes ~/.hermes/config.yaml and auto-edits it on startup. In multi-profile Hermes setups, this mutates the wrong config and breaks the intended routing.

Fix

  • Add _get_hermes_config_path() and _get_hermes_skills_dir() helpers in claw_adapter.py
  • These honor HERMES_CONFIG and HERMES_HOME before falling back to ~/.hermes
  • Updated _configure_hermes, inspect_hermes_config, and restore_hermes_config to use the new resolvers

Verified

SkillClaw hardcoded ~/.hermes/config.yaml and auto-edited the wrong
profile in multi-Hermes-home environments. Add env-aware resolvers for
config path and skills dir, and use them in configure/inspect/restore.
@MasterCATZ

MasterCATZ commented Aug 8, 2026 •

Copy link
Copy Markdown
Author

Note: this patch was AI-generated using Hermes Agent.
#71

@Upper9527

Copy link
Copy Markdown
Collaborator

The path-selection fix is useful and the test suite stays at the current main baseline, but skillclaw/claw_adapter.py does not pass the repository's Ruff formatting gate:

uvx ruff@0.12.2 format --check skillclaw/claw_adapter.py
# Would reformat: skillclaw/claw_adapter.py

Please format the file and update the branch. Note that this PR addresses the wrong-profile target from #71, but not the separate consent/config-import concerns in that issue.

@Upper9527 Upper9527 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two correctness gaps need to be resolved before this can safely support multiple profiles:

  • restore_hermes_config() now selects the target from HERMES_CONFIG/HERMES_HOME, but _latest_hermes_backup_path() still selects from one global backup directory without recording the original target. Configure profile A, then B, then restore A: the default restore can copy B's configuration (including its credentials/settings) into A. Scope backups by resolved config path, or refuse an implicit restore when the backup target cannot be verified. Add a two-profile backup/restore regression.
  • _get_hermes_skills_dir() is introduced but never used. ConfigStore's Hermes default and _prepare_hermes_skills_dir() / doctor still resolve the main profile's skills directory. Selecting HERMES_HOME therefore changes routing config while leaving skills on the wrong profile by default. Wire the same resolved home through the default-directory, setup, and diagnostic paths, preserving an explicitly configured custom skills.dir, and add tests for precedence and custom directories.

The previously noted Ruff format failure also remains in this diff. The separate consent/import concerns in #71 can remain follow-up work, but the cross-profile restore risk should not ship with path selection.

@Upper9527

Copy link
Copy Markdown
Collaborator

Superseded by merged #102. Thank you for identifying the HERMES_CONFIG/HERMES_HOME path-selection gap. The merged fix also adds explicit setup consent/import, persists the selected profile, wires skills defaults and diagnostics to it, and scopes backup/restore so a backup from another profile cannot overwrite the target. Closing this overlapping PR because its requested behavior is now covered on main.

@Upper9527 Upper9527 closed this Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants