mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-15 14:22:43 +00:00
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.
This commit is contained in:
parent
5693265775
commit
df886d0a45
1 changed files with 2 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue