From 66d81f9e14281f1f67f8f259a3a8cbae5c9d75df Mon Sep 17 00:00:00 2001 From: teknium1 <127238744+teknium1@users.noreply.github.com> Date: Sat, 23 May 2026 01:46:51 -0700 Subject: [PATCH] fix(gateway): don't swallow expansion errors in runtime config helper MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A bare except in _load_gateway_runtime_config would silently return the unexpanded dict on any _expand_env_vars failure — masking the very bug this helper exists to fix. Drop it; let the caller see real errors. --- gateway/run.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/gateway/run.py b/gateway/run.py index 77ab37f4279..5eaa19b7568 100644 --- a/gateway/run.py +++ b/gateway/run.py @@ -1315,17 +1315,17 @@ def _load_gateway_runtime_config() -> dict: ``config.yaml`` while still respecting tests that monkeypatch ``gateway.run._hermes_home``. Build on ``_load_gateway_config()`` rather than calling the canonical loader directly so both behaviors stay aligned. + + Expansion failures are intentionally NOT swallowed — silently returning + the unexpanded dict would mask the very bug this helper exists to fix. """ cfg = _load_gateway_config() if not isinstance(cfg, dict) or not cfg: return {} - try: - from hermes_cli.config import _expand_env_vars + from hermes_cli.config import _expand_env_vars - expanded = _expand_env_vars(cfg) - return expanded if isinstance(expanded, dict) else {} - except Exception: - return cfg + expanded = _expand_env_vars(cfg) + return expanded if isinstance(expanded, dict) else {} def _resolve_gateway_model(config: dict | None = None) -> str: