fix(tools_config): guard against None in known_plugin_toolsets config - #53196
Closed
17324393074 wants to merge 1 commit into
Closed
17324393074 wants to merge 1 commit into
17324393074 wants to merge 1 commit into
Conversation
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.
teknium1
added a commit
that referenced
this pull request
Jul 10, 2026
teknium1
added a commit
that referenced
this pull request
Jul 10, 2026
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.
Collaborator
|
Merged via PR #61835 — your commit was cherry-picked onto current main with authorship preserved in git history (df886d0). We also widened the same guard to the write path in the same module ( |
santhreal
pushed a commit
to santhreal/hermes-agent
that referenced
this pull request
Jul 13, 2026
santhreal
pushed a commit
to santhreal/hermes-agent
that referenced
this pull request
Jul 13, 2026
Sibling of the salvaged NousResearch#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.
justemu
pushed a commit
to justemu/hermes-agent
that referenced
this pull request
Jul 18, 2026
justemu
pushed a commit
to justemu/hermes-agent
that referenced
this pull request
Jul 18, 2026
Sibling of the salvaged NousResearch#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.
Gravezzz
pushed a commit
to Gravezzz/hermes-agent
that referenced
this pull request
Jul 21, 2026
Gravezzz
pushed a commit
to Gravezzz/hermes-agent
that referenced
this pull request
Jul 21, 2026
Sibling of the salvaged NousResearch#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.
leewenjie
pushed a commit
to leewenjie/hermes-agent
that referenced
this pull request
Aug 7, 2026
leewenjie
pushed a commit
to leewenjie/hermes-agent
that referenced
this pull request
Aug 7, 2026
Sibling of the salvaged NousResearch#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.
randlee
pushed a commit
to randlee/hermes-agent
that referenced
this pull request
Aug 11, 2026
randlee
pushed a commit
to randlee/hermes-agent
that referenced
this pull request
Aug 11, 2026
Sibling of the salvaged NousResearch#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.
melon-xf
added a commit
to melon-xf/hermes-agent
that referenced
this pull request
Sep 3, 2026
melon-xf
added a commit
to melon-xf/hermes-agent
that referenced
this pull request
Sep 3, 2026
Sibling of the salvaged NousResearch#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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When
config.yamlhasknown_plugin_toolsets: null(or any value mapped toNoneby the YAML loader),config.get("known_plugin_toolsets", {})returnsNone— because Python'sdict.getonly falls back to the default when the key is absent, not when its value isNone.The subsequent
set(known_map.get(platform, []))then crashes withTypeError: 'NoneType' object is not iterable, causing the gateway to fail to start and Hermes Desktop to show "Hermes couldn't start".Fix
or {}to guard againstknown_mapbeingNoneor []to guard againstknown_map.get(platform, [])returningNoneHow to reproduce
known_plugin_toolsets: nullorknown_plugin_toolsets:(empty) in~/.hermes/config.yaml_get_platform_tools(gateway, desktop, CLI)TypeError: 'NoneType' object is not iterableTesting
config.get("known_plugin_toolsets", {}) or {}returns{}when the value isNoneset(known_map.get("windows", []) or [])returnsset()when the key doesn't exist in the config