hermes - 💡(How to fix) Fix [Bug]: profile import creates a wrapper that does not preserve a custom HERMES_HOME [1 pull requests]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

Representative failure after import:

Error: Profile '<name>' does not exist. Create it with: hermes profile create <name>

The same wrapper works if I manually run it with the custom Hermes root exported first.

Root Cause

In practice, the import succeeds, the wrapper gets created, but running that wrapper from a normal shell fails because it resolves profiles against the default Hermes root instead of the custom one.

Fix Action

Fixed

Code Example

Report     https://paste.rs/XTEuC
agent.log  https://paste.rs/9j4ks

---

Representative failure after import:

`Error: Profile '<name>' does not exist. Create it with: hermes profile create <name>`

The same wrapper works if I manually run it with the custom Hermes root exported first.
RAW_BUFFERClick to expand / collapse

Bug Description

I ran into a real usage bug with hermes profile import in a custom HERMES_HOME.

The profile itself imports correctly into the custom root, but the generated wrapper script is still written as a plain global alias like:

exec hermes -p <name> "$@"

That means the wrapper no longer knows about the custom Hermes root that the profile was imported into.

In practice, the import succeeds, the wrapper gets created, but running that wrapper from a normal shell fails because it resolves profiles against the default Hermes root instead of the custom one.

What I expected instead was for the generated wrapper to preserve the custom HERMES_HOME context, so the imported profile can actually be launched through the alias it just created.

Steps to Reproduce

  1. Create or choose a non-default Hermes root, for example HERMES_HOME=/tmp/hermes-imported
  2. Import a profile archive with hermes profile import
  3. Notice that Hermes creates a wrapper in ~/.local/bin/<profile-name>
  4. Run that wrapper from a normal shell
  5. Observe that it fails to find the imported profile unless HERMES_HOME is manually exported again

Expected Behavior

If a profile is imported under a custom HERMES_HOME, the generated wrapper should preserve that Hermes root so the alias can actually launch the imported profile.

Actual Behavior

The imported profile is created in the custom Hermes root, but the generated wrapper is just a plain hermes -p <name> launcher.

As a result, the wrapper resolves profiles against the default Hermes root and fails to find the imported profile unless HERMES_HOME is manually re-exported.

Affected Component

CLI (interactive chat)

Messaging Platform (if gateway-related)

No response

Debug Report

Report     https://paste.rs/XTEuC
agent.log  https://paste.rs/9j4ks

Operating System

Ubuntu on WSL2 (Windows 11)

Python Version

Python 3.12.3

Hermes Version

Hermes Agent v0.14.0 (2026.5.16)

Additional Logs / Traceback (optional)

Representative failure after import:

`Error: Profile '<name>' does not exist. Create it with: hermes profile create <name>`

The same wrapper works if I manually run it with the custom Hermes root exported first.

Root Cause Analysis (optional)

The import itself uses the active/custom Hermes root correctly, but wrapper generation in hermes_cli.profiles.create_wrapper_script() writes a generic shell launcher that does not preserve the resolved Hermes root.

That means wrapper creation leaks out of the import context: the profile lives under the custom root, but the alias later resolves against the default root.

Proposed Fix (optional)

When wrapper scripts are generated from a non-standard Hermes root, the wrapper should export that resolved HERMES_HOME before executing hermes -p <name>.

I also prepared regression coverage for:

  • standard root wrappers staying unchanged
  • custom-root wrappers preserving HERMES_HOME

Are you willing to submit a PR for this?

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

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - 💡(How to fix) Fix [Bug]: profile import creates a wrapper that does not preserve a custom HERMES_HOME [1 pull requests]