feat(context): add GUIDELINES.md global prompt layer - #3972
Conversation
Load GUIDELINES.md from HERMES_HOME as a distinct global operating-guidelines layer and inject it into system prompt assembly after the explicit system message. Add prompt-builder and run_agent coverage for loading, ordering, injection blocking, truncation, and skip_context_files behavior. Co-Authored-By: Hermes Agent <no-reply@example.com>
teknium1
left a comment
There was a problem hiding this comment.
Thanks for adding a scoped global-context layer and coverage.
Problems
- The active prompt assembly has moved:
run_agent.py:3667-3670now forwards toagent/system_prompt.py, and its context tier is assembled atagent/system_prompt.py:443-455. The PR’srun_agent.pyintegration therefore needs to be relocated during salvage. - Proposed
agent/prompt_builder.py:719truncates withoutread_path. The helper falls back to the filename (agent/prompt_builder.py:1797), which would tellread_fileto open a relativeGUIDELINES.md, not the file underHERMES_HOME.
Suggested changes
- Wire the loader through
agent/system_prompt.py, preserving the currentrun_agentpatch seam. - Pass
read_path=str(guidelines_path)and cover the current system-prompt builder. - Update
website/docs/user-guide/features/context-files.mdand considerhermes_cli/profiles.py:236-244for profile export parity.
Automated hermes-sweeper review.
| "instructions override them.\n" | ||
| "This file is user-owned context, not persistent memory. Do not edit " | ||
| "it unless the user explicitly asks.\n\n" | ||
| "## GUIDELINES.md\n\n" |
There was a problem hiding this comment.
Please pass read_path=str(guidelines_path) here. _truncate_content otherwise uses the filename as its recovery target, so a truncated global file would instruct read_file to open a relative GUIDELINES.md in the workspace rather than the HERMES_HOME file.
|
Thanks for the review, @teknium1. You're right about both implementation issues. Prompt assembly moved to I have an alternate approach that addresses those points and updates the context-file docs. Before I port it onto current I also read your decision on #1812. From that, I understand the current product model:
I am not trying to reopen that implicit design or change project-context precedence. The interoperability problemOn my machine, Hermes is my daily driver, but the additional coding harnesses I use—Codex, Claude, and others—consume the same user-level Hermes does not consume that cross-harness file. To get the same technical policy into Hermes today, I have to copy it into I treat the two authored sources differently:
What I want to avoid is making Narrow proposalThe revised implementation uses one explicit, opt-in configuration value: context:
user_agents_path: ~/.config/agents/AGENTS.mdIts intended contract is deliberately small:
The default experience therefore keeps the existing single answer: global Hermes instructions go in Related work and what it tells us
The automated reviews on #11885 and #66155 suggest that an additive layer is technically safer than changing project lookup. I also recognize that those are automated salvage recommendations, not a human reversal of your product decision on #1812. Product-fit questionWould you consider this exact, explicit cross-harness import acceptable despite the decision on #1812? Put differently: can Hermes support an advanced opt-in bridge to a user-owned instruction file without treating that file as another canonical Hermes global location? If you think this fits the product, I will close this draft, port the implementation onto current Edit: If you agrees with the product direction, I would suggest that this closes #32395 with a scope note that: • the path is explicitly configured rather than automatically discovered; |
|
Also - thank you so much for Hermes! It would be an understatement to say that it has revolutionized the way I work with AI. |
Load GUIDELINES.md from HERMES_HOME as a distinct global operating-guidelines
layer and inject it into system prompt assembly after the explicit system
message.
Add prompt-builder and run_agent coverage for loading, ordering, injection
blocking, truncation, and skip_context_files behavior.
Co-Authored-By: Hermes Agent no-reply@example.com