fix: load_cli_config() now carries over non-default config keys
load_cli_config() only merged keys present in its hardcoded defaults dict, silently dropping user-added keys like platform_toolsets (saved by 'hermes tools'), provider_routing, memory, honcho, etc. Added a second pass to carry over all file_config keys that aren't in defaults, so 'hermes tools' changes actually take effect in CLI mode. The gateway was unaffected (reads YAML directly via yaml.safe_load).
This commit is contained in:
9
cli.py
9
cli.py
@@ -229,7 +229,8 @@ def load_cli_config() -> Dict[str, Any]:
|
||||
# Old format: model is a dict with default/base_url
|
||||
defaults["model"].update(file_config["model"])
|
||||
|
||||
# Deep merge other keys with defaults
|
||||
# Deep merge file_config into defaults.
|
||||
# First: merge keys that exist in both (deep-merge dicts, overwrite scalars)
|
||||
for key in defaults:
|
||||
if key == "model":
|
||||
continue # Already handled above
|
||||
@@ -239,6 +240,12 @@ def load_cli_config() -> Dict[str, Any]:
|
||||
else:
|
||||
defaults[key] = file_config[key]
|
||||
|
||||
# Second: carry over keys from file_config that aren't in defaults
|
||||
# (e.g. platform_toolsets, provider_routing, memory, honcho, etc.)
|
||||
for key in file_config:
|
||||
if key not in defaults and key != "model":
|
||||
defaults[key] = file_config[key]
|
||||
|
||||
# Handle root-level max_turns (backwards compat) - copy to agent.max_turns
|
||||
if "max_turns" in file_config and "agent" not in file_config:
|
||||
defaults["agent"]["max_turns"] = file_config["max_turns"]
|
||||
|
||||
Reference in New Issue
Block a user