Skip to content

fix(toolsets): validate dynamic hermes-<platform> toolsets for plugin platforms - #57230

Draft
sonisoft-cnanda wants to merge 1 commit into
NousResearch:mainfrom
SoniSoft-IO:fix/validate-toolset-plugin-platforms
Draft

sonisoft-cnanda wants to merge 1 commit into
NousResearch:mainfrom
SoniSoft-IO:fix/validate-toolset-plugin-platforms

Conversation

@sonisoft-cnanda

Copy link
Copy Markdown

resolve_toolset generates a dynamic hermes-<platform> toolset for plugin platforms (core tools + any tool registered under the platform's name), but validate_toolset has no matching branch. Built-in platforms (telegram/discord/slack) validate via their static TOOLSETS entries; plugin platforms (e.g. teams, google_chat) do not.

Because callers gate on validate_toolset before resolving — notably model_tools._get_tools (the loop mapping enabled_toolsets → tool schemas) — hermes-<platform> is treated as an unknown toolset and silently dropped. Any tool a plugin platform registers under its own toolset therefore never reaches the model. Core tools still arrive via other inferred toolsets, which masks the bug. Surfaced when a plugin platform shipped its first model tool.

Fix: mirror resolve_toolset's dynamic handling in validate_toolset — accept hermes-<platform> when that platform is registered in platform_registry.

Config-only workaround for operators: platform_toolsets.<platform>: [hermes-<platform>, <platform>].

@alt-glitch alt-glitch added type/bug Something isn't working comp/tools Tool registry, model_tools, toolsets comp/plugins Plugin system and bundled plugins P3 Low — cosmetic, nice to have labels Jul 2, 2026
… platforms

`resolve_toolset` generates a dynamic `hermes-<platform>` toolset for plugin
platforms (core tools + any tool registered under the platform's name), but
`validate_toolset` had no matching branch. Built-in platforms
(telegram/discord/slack) validate via their static `TOOLSETS` entries, but
plugin platforms (e.g. teams, google_chat) do not.

As a result, callers that gate on `validate_toolset` before resolving —
notably `model_tools._get_tools` — treat `hermes-teams` as an unknown
toolset and silently drop it, so any tool a plugin platform registers under
its own toolset never reaches the model. (Core tools still arrive via other
inferred toolsets, which masks the bug.) This surfaced when a plugin
platform shipped its first tool.

Fix: mirror `resolve_toolset`'s dynamic handling in `validate_toolset` —
accept `hermes-<platform>` when the platform is registered.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@sonisoft-cnanda
sonisoft-cnanda force-pushed the fix/validate-toolset-plugin-platforms branch from ebc4485 to d52572a Compare July 2, 2026 18:01
@teknium1

Copy link
Copy Markdown
Collaborator

Thanks for tracing this through the validation gate. The premise reproduces on current main: toolsets.py:731-752 resolves a registered dynamic hermes-<platform> bundle, but toolsets.py:862-879 rejects it; model_tools.py:377-388 therefore drops it before resolution. The proposed platform_registry.is_registered() predicate mirrors the resolver's condition.

Problems

  • The PR adds no regression coverage. tests/test_toolsets.py:121-198 covers static, MCP-alias, and registry-owned toolsets, but not a registered platform's dynamic hermes-<platform> bundle.

Suggested changes

  • Add a focused test registering a synthetic platform and platform-scoped tool, then assert both validate_toolset('hermes-<platform>') and resolve_toolset('hermes-<platform>') preserve the dynamic bundle.

Automated hermes-sweeper review.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/plugins Plugin system and bundled plugins comp/tools Tool registry, model_tools, toolsets P3 Low — cosmetic, nice to have sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants