From 7ef54ba04f115ec11b6626b59a4577dae38b6d5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=BE=BE=E4=BB=A4=E5=B0=8F=E6=96=B0?= Date: Mon, 8 Jun 2026 17:54:23 +0800 Subject: [PATCH] fix(config): map `provider` shortcut to `model.provider` for hermes config set Fixes #41943 --- hermes_cli/config.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/hermes_cli/config.py b/hermes_cli/config.py index fc98998c2005c..d89ec29cd3afd 100644 --- a/hermes_cli/config.py +++ b/hermes_cli/config.py @@ -6028,6 +6028,20 @@ def set_config_value(key: str, value: str): elif value.replace('.', '', 1).isdigit(): value = float(value) + # Map user-friendly key shortcuts to canonical nested config paths. + # This lets users write \`hermes config set provider X\` instead of + # having to remember \`hermes config set model.provider X\`. + _CONFIG_KEY_ALIASES = { + "provider": "model.provider", + } + if key in _CONFIG_KEY_ALIASES: + canonical = _CONFIG_KEY_ALIASES[key] + print(f"'{key}' is a shortcut for '{canonical}'; redirecting") + # Clean up any legacy bare key that might linger from a previous write + if key in user_config: + del user_config[key] + key = canonical + _set_nested(user_config, key, value) # Write only user config back (not the full merged defaults)