From df886d0a4569276c818dc10be9a5d2f68e80c67e Mon Sep 17 00:00:00 2001 From: sonxi Date: Sat, 27 Jun 2026 00:10:08 +0800 Subject: [PATCH] fix(tools_config): guard against None in known_plugin_toolsets config When config.yaml has known_plugin_toolsets set to null (or any value mapped to None by the YAML loader), config.get returns None (dict.get only falls back to the default when the key is absent, not when its value is None). The subsequent set(known_map.get(platform, [])) then crashes with TypeError: NoneType object is not iterable and the gateway fails to start, even though no plugin toolsets are configured. Add or-empty-dict and or-empty-list guards so a null/None value is treated as empty instead of crashing the platform-tools resolver. --- hermes_cli/tools_config.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hermes_cli/tools_config.py b/hermes_cli/tools_config.py index ee376274177..acadd4b81fc 100644 --- a/hermes_cli/tools_config.py +++ b/hermes_cli/tools_config.py @@ -1830,8 +1830,8 @@ def _get_platform_tools( # has been saved for that platform (tracked via known_plugin_toolsets). # Unknown plugins default to enabled; known-but-absent = disabled. if plugin_ts_keys: - known_map = config.get("known_plugin_toolsets", {}) - known_for_platform = set(known_map.get(platform, [])) + known_map = config.get("known_plugin_toolsets", {}) or {} + known_for_platform = set(known_map.get(platform, []) or []) for pts in plugin_ts_keys: if pts in toolset_names: # Explicitly listed in config — enabled