feat(config): implement profile config inheritance from default#20964
Draft
frap129 wants to merge 6 commits into
Draft
feat(config): implement profile config inheritance from default#20964frap129 wants to merge 6 commits into
frap129 wants to merge 6 commits into
Conversation
…Research#20270) Allow profile configs to automatically inherit from ~/.hermes/config.yaml (default profile), eliminating the need to duplicate shared configuration across N profiles. Profiles now contain only overrides. Changes: - hermes_constants: add get_default_config_path() helper - config.py: add _should_inherit() detection (comment header / inherit:false flag) - config.py: add _is_override() and _compute_overrides_only() helpers - config.py: extend load_config() with inherit_from param and _AUTO_INHERIT sentinel - config.py: update save_config() to write only overrides for inherited profiles - config.py: enhance show_config() with Profile section and (override)/(inherited) tags - config.py: add _tag() helper with subkey-level accuracy for nested values - main.py: add --inherits/--no-inherit boolean toggle to profile create - profiles.py: add INHERITANCE_SKELETON_YAML and FULL_CONFIG_SKELETON_YAML templates - profiles.py: update create_profile() to accept inherits parameter - tests: add 7 config inheritance tests + 4 profile inheritance tests Backward compatible: existing profiles with full configs are unaffected (no inheritance comment header = standalone behavior preserved).
…detection Replace the '# This profile inherits' string scan in _should_inherit() with an explicit inherit: true YAML key check. The comment heuristic was fragile and not a proper configuration mechanism. Backward compatible — existing profiles without the inherit flag remain standalone.
Replace the comment-only inheritance skeleton with an explicit inherit: true YAML key. Update standalone template to include inherit: false. Remove the misleading 'hermes config set --profile --no-inherit' instruction which doesn't exist as a command.
Rename test_should_inherit_with_comment_header to test_should_inherit_with_explicit_true and update the test fixture to use inherit: true instead of a comment header.
Document the config inheritance feature: - New 'Config inheritance' section covering how inheritance works (inherit: true/false YAML key), creation flags, saving/viewing overrides, opt-out flow, and use cases
Add inherited profile config as a new resolution layer between CLI arguments and the default config.yaml. Add a tip box linking to the new Config Inheritance section in profiles.md.
|
Thanks for doing this! Seconding this PR, as the lack of inheritance right now leads to extremely confusing behavior between restarts when trying to configure Docker containers – especially when trying to maintain env vars to propagate from |
This was referenced Jun 8, 2026
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?
Allow profile configs to automatically inherit from ~/.hermes/config.yaml (default profile), eliminating the need to duplicate shared configuration across N profiles. Profiles now contain only overrides.
Backward compatible: existing profiles with full configs are unaffected (no inheritance comment header = standalone behavior preserved).
Related Issue
Fixes #20270
Type of Change
Changes Made
How to Test
--inheritChecklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) — or N/Acli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/AFor New Skills
hermes --toolsets skills -q "Use the X skill to do Y"Screenshots / Logs