mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-15 14:22:43 +00:00
fix(tools_config): widen null guard to known_plugin_toolsets write path
Sibling of the salvaged #53196 read-path fix: setdefault() does not replace a present-but-null key, so saving platform tools with known_plugin_toolsets: null in config.yaml crashed on indexing None.
This commit is contained in:
parent
c9d5491205
commit
07271a6f62
1 changed files with 4 additions and 1 deletions
|
|
@ -1980,7 +1980,10 @@ def _save_platform_tools(config: dict, platform: str, enabled_toolset_keys: Set[
|
|||
# Track which plugin toolsets are "known" for this platform so we can
|
||||
# distinguish "new plugin, default enabled" from "user disabled it".
|
||||
if plugin_keys:
|
||||
config.setdefault("known_plugin_toolsets", {})
|
||||
# setdefault does NOT replace a present-but-null key ("known_plugin_toolsets:"
|
||||
# in config.yaml parses to None) — normalize before indexing into it.
|
||||
if not isinstance(config.get("known_plugin_toolsets"), dict):
|
||||
config["known_plugin_toolsets"] = {}
|
||||
config["known_plugin_toolsets"][platform] = sorted(plugin_keys)
|
||||
|
||||
# Reconcile with agent.disabled_toolsets. _get_platform_tools() applies
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue