Conversation
Currently AGENTS.md is only loaded from the workspace/cwd directory. For multi-profile setups (e.g. distinct role rules per profile), each profile needs its own AGENTS.md with role-specific constraints. This change introduces a profile-first lookup: get_hermes_home()/AGENTS.md takes priority, cwd/AGENTS.md serves as fallback. This mirrors the existing SOUL.md loading pattern.
teknium1
reviewed
Jul 15, 2026
teknium1
left a comment
Collaborator
There was a problem hiding this comment.
Thanks for the focused profile-context proposal.
Problems
agent/prompt_builder.py:1685returns profileAGENTS.mdbefore checking the workspace. That suppresses a repository's project instructions whenever the profile file exists. Current main documentsAGENTS.mdas CWD project context (website/docs/user-guide/features/context-files.md:16,28-32) and reserves$HERMES_HOME/SOUL.mdfor profile-wide identity (website/docs/user-guide/features/personality.md:32-47). Commit725831171also deliberately limited AGENTS startup lookup to the working-directory root.- The PR changes this resolution contract without tests. Main's existing contract test is
tests/agent/test_prompt_builder.py:758-766; no profile-vs-workspace precedence or fallback test is included.
Suggested changes
- Please have maintainers settle the desired profile-wide instruction surface and its precedence relative to workspace instructions before changing this loader. If profile-level AGENTS is adopted, document the resulting contract and add hermetic tests for profile-only, workspace-only, both-present, and empty-profile cases.
Automated hermes-sweeper review.
| hermes_home = get_hermes_home() | ||
| for name in ["AGENTS.md", "agents.md"]: | ||
| # Profile-level AGENTS.md takes priority (mirrors SOUL.md pattern) | ||
| profile_candidate = hermes_home / name |
Collaborator
There was a problem hiding this comment.
This precedence makes a profile AGENTS.md suppress the workspace AGENTS.md rather than fall back to it. Current main treats AGENTS.md as CWD project context and HERMES_HOME/SOUL.md as profile-wide identity; please settle and document the intended source-of-truth/precedence before changing this branch.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently AGENTS.md is only loaded from the workspace/cwd directory. For multi-profile setups (e.g. distinct role rules per profile), each profile needs its own AGENTS.md with role-specific constraints.
This change introduces a profile-first lookup:
get_hermes_home()/AGENTS.mdtakes priority,cwd/AGENTS.mdserves as fallback. This mirrors the existing SOUL.md loading pattern.