From 45b2e4dd6b713a1dbc3252c65b717da715631488 Mon Sep 17 00:00:00 2001 From: Teknium <127238744+teknium1@users.noreply.github.com> Date: Sat, 27 Jun 2026 19:19:54 -0700 Subject: [PATCH] fix(config): opt newer migrations out of default-stripping The salvaged #27354 fix made save_config strip schema-default leaves by default. Five migration sites added to main after the PR was authored still called bare save_config(config) and intentionally materialize a (often default-valued) key: model_catalog.ttl_hours, write_approval, curator.consolidate, agent.verify_on_stop, and the suspicious-MCP-server disable. Pass strip_defaults=False so those one-time deliberate writes survive, matching the opt-out the PR applied to the other migrations. --- hermes_cli/config.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hermes_cli/config.py b/hermes_cli/config.py index 5cbf69dc7..a3496597e 100644 --- a/hermes_cli/config.py +++ b/hermes_cli/config.py @@ -5248,7 +5248,7 @@ def migrate_config(interactive: bool = True, quiet: bool = False) -> Dict[str, A if isinstance(raw_mc, dict) and raw_mc.get("ttl_hours") == 24: raw_mc["ttl_hours"] = 1 config["model_catalog"] = raw_mc - save_config(config) + save_config(config, strip_defaults=False) results["config_added"].append("model_catalog.ttl_hours 24→1") if not quiet: print(" ✓ Lowered model_catalog.ttl_hours to 1 (hourly picker refresh)") @@ -5277,7 +5277,7 @@ def migrate_config(interactive: bool = True, quiet: bool = False) -> Dict[str, A f"{subsystem}.write_mode → write_approval={sub['write_approval']}" ) if touched: - save_config(config) + save_config(config, strip_defaults=False) if not quiet: print(" ✓ Renamed write_mode → write_approval (boolean gate)") @@ -5296,7 +5296,7 @@ def migrate_config(interactive: bool = True, quiet: bool = False) -> Dict[str, A if isinstance(raw_curator, dict) and "consolidate" not in raw_curator: raw_curator["consolidate"] = False config["curator"] = raw_curator - save_config(config) + save_config(config, strip_defaults=False) results["config_added"].append("curator.consolidate=false") if not quiet: print( @@ -5325,7 +5325,7 @@ def migrate_config(interactive: bool = True, quiet: bool = False) -> Dict[str, A if cur is None or is_auto_sentinel: raw_agent["verify_on_stop"] = False config["agent"] = raw_agent - save_config(config) + save_config(config, strip_defaults=False) results["config_added"].append("agent.verify_on_stop=false") if not quiet: print( @@ -5364,7 +5364,7 @@ def migrate_config(interactive: bool = True, quiet: bool = False) -> Dict[str, A print(f" ⚠ Disabled MCP server '{server_name}' pending review") if mcp_touched: config["mcp_servers"] = raw_mcp_servers - save_config(config) + save_config(config, strip_defaults=False) # ── Always: validate platform_toolsets after migration ── # A migration (or hand-edit) that leaves an invalid toolset name in