Skip to content

feat: preserve user config values during hermes setup and config regeneration #3522

@domvox

Description

@domvox

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions