feat(prompt-builder): load AGENTS.md from profile home alongside project context (#104640) - #104761
Open
ericmaddox wants to merge 1 commit into
Open
ericmaddox wants to merge 1 commit into
ericmaddox wants to merge 1 commit into
Conversation
Contributor
Related: #66155, #23331 and #52580 are open PRs that also load |
ericmaddox
force-pushed
the
feature/profile-home-agents-md-104640
branch
from
September 7, 2026 21:08
959d0f8 to
9a579d0
Compare
ericmaddox
force-pushed
the
feature/profile-home-agents-md-104640
branch
from
September 10, 2026 01:02
9a579d0 to
924cf3a
Compare
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.
What does this PR do?
Resolves #104640.
A profile configured for a specific operational role (reviewer, implementer, domain specialist) often defines an operating contract (how reviews are decided, output formats, persona-specific constraints).
Previously,
agent/prompt_builder.pyonly loadedAGENTS.mdfrom the directory chain between the git root and the session's working directory (_agents_md_directory_chain), and loadedSOUL.mdalone from the profile home (HERMES_HOME). As a result, an operating contract placed at<profile home>/AGENTS.mdwas never loaded into the prompt when working in repositories or directories outside the profile home.Changes Made
agent/prompt_builder.py:load_profile_agents_md(context_length, home_override)to look forAGENTS.override.md,AGENTS.md, andagents.mdinHERMES_HOME(orhome_override).build_context_files_prompt()to load profileAGENTS.mdalongside project context andSOUL.md, deduplicating if the working directory already loaded identical instructions.tests/agent/test_prompt_builder.py:AGENTS.mdandAGENTS.override.mdfrom profile home.AGENTS.mdconcurrently with project-levelAGENTS.md.Related Issue
Fixes #104640
Type of Change
Checklist
fix(scope):,feat(scope):, etc.)pytest tests/and all relevant tests pass