fix(toolsets): platform plugins without a static bundle silently get zero tools; config set stores list literals as strings - #855
Open
hashbender wants to merge 1 commit into
Open
Conversation
…zero tools; config set stores list literals as strings
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.
What does this PR do?
Fixes two silent-failure paths that leave a gateway platform running with zero tools while everything looks configured.
1. Eight bundled platform plugins ship without a
hermes-<platform>static bundle_get_platform_toolsfalls back tohermes-<platform>for any platform missing from config'splatform_toolsets, andresolve_toolsetreturns[]for an unknown name (the NousResearch#38798 shape). The runtime auto-generate inresolve_toolsetonly fires oncegateway.platform_registryhas the platform registered, so outside the gateway process (cron delivery, kanban dispatch,hermes tools, doctor) — and in the explicit-config composite expansion, which skips names absent fromTOOLSETS— these platforms silently degrade to zero tools:line,google_chat,teams,irc,ntfy,photon,simplex,raftLINE shipped this way in NousResearch#23197 ("zero core edits" by design). Real-world impact we hit: a LINE deployment ran for weeks with a zero-tool agent — no
read_file, nomemory, no MCP servers — so the model could only ask the user for information it was supposed to look up; every turn wasapi_calls=1with no diagnostic anywhere.Fix: add the 8 missing static bundles (core tools, mirroring
hermes-telegram/hermes-signal), include them in thehermes-gatewaycomposite, and add a regression test that walksplugins/platforms/so the next platform plugin cannot ship without a bundle.2.
hermes config setstores list/mapping literals as stringsset_config_valueonly coerces bool/int/float. A list literal (e.g.hermes config set platform_toolsets.discord '["clarify","file",...]') is stored as a raw string with no warning — and every reader gated onisinstance(..., list)(_get_platform_tools,_get_enabled_set,_get_disabled_set) silently ignores it and falls back to its default. The setting looks saved but never takes effect. We found both aplatform_toolsetsentry and aplugins.enabledentry in this state in the wild.Fix: values starting with
[or{are parsed withyaml.safe_load; non-list/dict results and YAML errors warn on stderr and keep the legacy string behavior.Tests
tests/test_toolsets.py::TestBundledPlatformBundles— everyplugins/platforms/<name>/with aplugin.yamlmust have a non-empty static bundle (include_registry=False); the 8 new bundles resolve to core tools; gateway composite includes them.tests/hermes_cli/test_config_set_list_values.py— list/mapping literals parse to real lists/dicts, YAML flow lists work, invalid literals warn and keep string behavior, scalars unaffected.tests/test_toolsets.py,tests/hermes_cli/test_tools_config.py,tests/hermes_cli/test_managed_scope_writeguard.py,tests/test_toolset_distributions.py: 170 passed.Related
Mirror-of: NousResearch#57063
NousResearch#57063