Skip to content

fix(prompt): anchor active-profile hint at HERMES_HOME, not a nested path - #77731

Closed
33hodl wants to merge 1 commit into
NousResearch:mainfrom
33hodl:fix/profile-prompt-nested-path
Closed

33hodl wants to merge 1 commit into
NousResearch:mainfrom
33hodl:fix/profile-prompt-nested-path

Conversation

@33hodl

@33hodl 33hodl commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Summary

When a named profile is active, HERMES_HOME is already profile-scoped (e.g. ~/.hermes/profiles/setup-radar-lab), but agent/system_prompt.py's active-profile hint appended /profiles/<name>/ again, fabricating a non-existent nested path like:

~/.hermes/profiles/setup-radar-lab/profiles/setup-radar-lab/

Agents in profile-scoped desktop sessions were told their session reads/writes a phantom directory. The session's own data actually lives at HERMES_HOME itself; the default profile's data lives under the root (parent of profiles/).

Change

  • Active-profile hint now says the session reads/writes HERMES_HOME directly.
  • The default profile's data is anchored at get_default_hermes_root() instead of being mis-derived from the profile-scoped home.
  • Regression test test_profile_prompt_no_nested_profiles_path covers the non-default profile branch.

Test plan

python -m pytest tests/agent/test_system_prompt.py -o 'addopts=' -q
# 11 passed (incl. new regression test)

@alt-glitch alt-glitch added type/bug Something isn't working comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint area/profiles Multi-profile isolation, HERMES_HOME scoping sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades P3 Low — cosmetic, nice to have duplicate This issue or pull request already exists labels Aug 3, 2026
@alt-glitch

Copy link
Copy Markdown
Contributor

This was generated by AI during triage.

Duplicate of #74979: current diffs repair the same doubled named-profile path using the same HERMES_HOME/default-root model. #74979 is the older open implementation with broader integration coverage.

…path

When a profile is active, HERMES_HOME is already profile-scoped (e.g.
~/.hermes/profiles/foo), but the active-profile hint appended
/profiles/<name>/ again, fabricating a non-existent nested path like
~/.hermes/profiles/foo/profiles/foo/. The session's own data lives at
HERMES_HOME itself; the default profile's data lives under the root.

Fixes the phantom nested profile dir shown to agents in profile-scoped
desktop sessions. Adds a regression test covering the non-default
profile branch.
@33hodl
33hodl force-pushed the fix/profile-prompt-nested-path branch from 4594a1b to f9940c0 Compare August 10, 2026 10:30
@33hodl

33hodl commented Aug 10, 2026

Copy link
Copy Markdown
Contributor Author

Closing as a duplicate of #74979, which fixes the same doubled-profile-path defect with stronger integration tests that drive the real resolver chain (this PR mocked the resolver instead). Deferring to that PR — thanks for the thorough work there.

@33hodl 33hodl closed this Aug 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/profiles Multi-profile isolation, HERMES_HOME scoping comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint duplicate This issue or pull request already exists P3 Low — cosmetic, nice to have sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants