Skip to content

fix(cli): validate plugin toolsets against persisted plugin-key cache - #109938

Closed
iskandarsulaili wants to merge 1 commit into
NousResearch:mainfrom
iskandarsulaili:fix/cli-toolset-validation
Closed

iskandarsulaili wants to merge 1 commit into
NousResearch:mainfrom
iskandarsulaili:fix/cli-toolset-validation

Conversation

@iskandarsulaili

Copy link
Copy Markdown

What

HermesCLI._init_toolsets validated toolset names only against the live tool registry, but plugins register their toolsets in a background discovery thread that may not have joined by the time init runs. Every enabled plugin toolset (e.g. agents, lsp, vault, searxng, orchestra) was therefore falsely printed as:

Warning: Unknown toolsets: agents, anchored, cloakbrowser, ...

while the tools themselves still loaded fine — pure warning noise on every CLI start.

Fix

Also accept the persisted plugin-toolset-key cache (get_plugin_toolset_keys_nowait()) when validating, matching the exact pattern already used by hermes_cli/oneshot.py (_validate_explicit_toolsets) and tui_gateway/server.py (_resolve_explicit_toolsets). Import is tolerant; on any exception the set is empty and behavior falls back to today's code.

Why this is safe

  • get_plugin_toolset_keys_nowait() returns the persisted cache while background discovery is in flight (never blocks), and self-heals on the next scan.
  • Only silences the false "unknown" notice; does not change which tools load.
  • Mirrors the two existing validated-code sites for the identical problem.
  • Tests for validate_toolset() are unchanged (static + plugin-registered + MCP names still validate as before).

Reproduction

$ hermes
Warning: Unknown toolsets: agents, anchored, cloakbrowser, codegraph, codegraph-context, cross-memory, dsh, effect, google_meet, graphify, lsp, memory-tdai, moa-trigger, orchestra, searxng, semble, vault

_init_toolsets validated names only against the live tool registry, but
plugins register their toolsets in a background discovery thread that may
not have joined yet. Every enabled plugin toolset (agents, lsp, vault,
searxng, ...) was therefore falsely printed as 'Warning: Unknown toolsets'
while the tools themselves still loaded. Match the pattern already used by
oneshot.py and tui_gateway: also accept the persisted plugin-toolset-key
cache so the warning is silent for valid plugin names.
@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/cli CLI entry point, hermes_cli/, setup wizard comp/plugins Plugin system and bundled plugins duplicate This issue or pull request already exists labels Sep 13, 2026
@alt-glitch

Copy link
Copy Markdown

This was generated by AI during triage.

Duplicate of #89345 -- that open PR applies the same get_plugin_toolset_keys_nowait() check in cli.py._init_toolsets (plus the subagent-lifecycle path and tests). Related competing approaches: #91761, #29774, #25714.

@iskandarsulaili

Copy link
Copy Markdown
Author

Closing as a duplicate. Superseded by #89345 (adamkrawczyk), which applies the same get_plugin_toolset_keys_nowait() fix in cli.py plus the subagent_lifecycle.py validation path and regression tests. No further action needed on this PR.

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

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard comp/plugins Plugin system and bundled plugins duplicate This issue or pull request already exists P3 Low — cosmetic, nice to have type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants