Skip to content

The agent that grows with you

fix(config): recognize extra known root keys in config set validation

Hassan Raza0fac64991eea
diff --git a/hermes_cli/config.py b/hermes_cli/config.py
index e44fa5bc430..f7c11b45bf4 100644
--- a/hermes_cli/config.py
+++ b/hermes_cli/config.py
@@ -3278,8 +3278,13 @@ _OPEN_SUBKEY_TOP_LEVEL_KEYS = _OPEN_DICT_TOP_LEVEL_KEYS | _DYNAMIC_TOP_LEVEL_KEY
def _known_top_level_keys() -> set[str]:
- """Return the union of known top-level config keys for validation."""
- return set(DEFAULT_CONFIG) | _OPEN_SUBKEY_TOP_LEVEL_KEYS
+ """Return the union of known top-level config keys for validation.
+
+ ``_EXTRA_KNOWN_ROOT_KEYS`` are roots the runtime reads but DEFAULT_CONFIG deliberately
+ omits (``platform_toolsets``, ``smart_model_routing``, ...); without them every path under
+ such a root was flagged "not a recognized config key" with a difflib near-miss suggestion.
+ """
+ return set(DEFAULT_CONFIG) | _EXTRA_KNOWN_ROOT_KEYS | _OPEN_SUBKEY_TOP_LEVEL_KEYS
def _suggest_closest_key(key: str, candidates: set[str], cutoff: float = 0.6) -> Optional[str]:
diff --git a/tests/hermes_cli/test_set_config_value.py b/tests/hermes_cli/test_set_config_value.py
index 2e59b4be939..ce5c351bc0d 100644
--- a/tests/hermes_cli/test_set_config_value.py
+++ b/tests/hermes_cli/test_set_config_value.py
@@ -609,6 +609,11 @@ class TestValidateConfigKey:
"platforms.discord.enabled",
"gateway.platforms.my_platform.extra.token",
"approvals.mode",
+ # _EXTRA_KNOWN_ROOT_KEYS: read by the runtime (setup wizard / tools_config save flow)
+ # but absent from DEFAULT_CONFIG; they used to trip the false "not a recognized config
+ # key" notice with a bogus near-miss suggestion (platform_hints.cli).
+ "platform_toolsets.cli",
+ "smart_model_routing.enabled",
])
def test_known_keys_pass(self, key):
from hermes_cli.config import _validate_config_key