Problem
When running hermes setup or when config is regenerated (e.g. after a major version upgrade), user-customized values in ~/.hermes/config.yaml can be silently reset to defaults.
Real-world example: compression.threshold was customized from 0.50 to 0.80 to prevent compaction loops with local models (Qwen3.5-27B on llama.cpp, 32K context). After upgrading to v0.4.0 and running setup, the value reverted to 0.50 — causing the exact compaction loop the user had previously fixed.
Other values at risk: provider_routing, privacy.redact_pii, compression.summary_provider, custom auxiliary model configs, platforms settings.
Expected behavior
User-modified config values should survive hermes setup and version upgrades. The existing _deep_merge() in load_config() handles this correctly at runtime, but hermes setup can overwrite the entire file.
Proposed solution
Before writing a new config.yaml in setup flows, load the existing config and merge new defaults underneath (user values take precedence):
if config_path.exists():
existing = yaml.safe_load(config_path.read_text()) or {}
new_config = _deep_merge(new_defaults, existing) # existing wins
Alternatively, hermes setup could create a timestamped backup before overwriting:
~/.hermes/config.yaml.bak.20260328
Environment
- Hermes Agent v0.4.0 (v2026.3.23)
- Local model: Qwen3.5-27B via llama.cpp (32K context)
- Platform: Ubuntu, self-hosted Matrix gateway
- Config customizations: compression threshold, PII redaction, ZDR provider routing
Problem
When running
hermes setupor when config is regenerated (e.g. after a major version upgrade), user-customized values in~/.hermes/config.yamlcan be silently reset to defaults.Real-world example:
compression.thresholdwas customized from0.50to0.80to prevent compaction loops with local models (Qwen3.5-27B on llama.cpp, 32K context). After upgrading to v0.4.0 and running setup, the value reverted to0.50— causing the exact compaction loop the user had previously fixed.Other values at risk:
provider_routing,privacy.redact_pii,compression.summary_provider, customauxiliarymodel configs,platformssettings.Expected behavior
User-modified config values should survive
hermes setupand version upgrades. The existing_deep_merge()inload_config()handles this correctly at runtime, buthermes setupcan overwrite the entire file.Proposed solution
Before writing a new
config.yamlin setup flows, load the existing config and merge new defaults underneath (user values take precedence):Alternatively,
hermes setupcould create a timestamped backup before overwriting:Environment