Skip to content

fix(cli): run plugin discovery before toolset validation - #71729

Closed
Linux2010 wants to merge 1 commit into
NousResearch:mainfrom
Linux2010:fix/toolset-validation-after-plugin-load-71650
Closed

Linux2010 wants to merge 1 commit into
NousResearch:mainfrom
Linux2010:fix/toolset-validation-after-plugin-load-71650

Conversation

@Linux2010

Copy link
Copy Markdown

Summary

HermesCLI.__init__ called validate_toolset() before discover_plugins(), so plugin-registered toolsets (e.g. beads, spotify) were always flagged as Warning: Unknown toolsets on every startup — even though they worked correctly at runtime.

Root Cause

cli.py:4283-4290 — the validation block queries tools.registry via validate_toolset() → _get_plugin_toolset_names(), but the registry isn't populated with plugin toolsets until discover_plugins() runs. The comment already noted that "discovery hasn't run yet" (referring to MCP), but the same gap applied to plugin-registered toolsets.

Fix

Run discover_plugins() (best-effort, exception-silenced) before the validation block so the tool registry reflects plugin entries.

Live Proof

BEFORE — validate_toolset("spotify") = False
  (spotify plugin not loaded → registry doesn't know it)

AFTER — validate_toolset("spotify") = True
  (discover_plugins() runs first → registry contains spotify tools)

Test run

$ .venv/bin/python -m pytest tests/hermes_cli/test_toolset_validation.py -v
13 passed

Risk

Low. discover_plugins() is idempotent and already called elsewhere during startup. The call is exception-guarded so plugin discovery failure does not block CLI startup.

validate_toolset() in HermesCLI.__init__ ran before discover_plugins(),
so plugin-registered toolsets (e.g. beads, spotify) were always
reported as "Unknown toolsets" on every startup — a false-positive
warning because the toolsets were valid and worked at runtime.

Run discover_plugins() before the validation block so the tool
registry reflects plugin entries. MCP server names are still excluded
from validation since MCP discovery hasn't run yet.

Closes NousResearch#71650
@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 Jul 26, 2026
@alt-glitch

Copy link
Copy Markdown

This was generated by AI during triage.

Duplicate of #29774: both patches address the same CLI ordering defect by discovering plugin toolsets before validation.

@Linux2010

Copy link
Copy Markdown
Author

Closing as duplicate of #29774. Please merge that PR instead.

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