Skip to content

fix: include entry-point plugins in CLI list/enable/disable commands#23814

Open
vanthinh6886 wants to merge 1 commit into
NousResearch:mainfrom
vanthinh6886:fix/plugins-entrypoint-discovery
Open

fix: include entry-point plugins in CLI list/enable/disable commands#23814
vanthinh6886 wants to merge 1 commit into
NousResearch:mainfrom
vanthinh6886:fix/plugins-entrypoint-discovery

Conversation

@vanthinh6886

Copy link
Copy Markdown
Contributor

Problem

hermes plugins list and hermes plugins enable/disable do not show pip-installed entry-point plugins, even though PluginManager.discover_and_load() discovers and loads them correctly at runtime.

Operators who install a Hermes plugin via pip install <package> see the plugin's adapters, hooks, and CLI commands work, but the management surfaces behave as if the plugin doesn't exist:

  • hermes plugins list omits it
  • hermes plugins enable <name> returns "Plugin '' is not installed or bundled"

Root Cause

_discover_all_plugins() and _plugin_exists() in hermes_cli/plugins_cmd.py only scan two filesystem directories (bundled + user), while PluginManager.discover_and_load() in plugins.py has a 4th discovery source: importlib.metadata.entry_points(group="hermes_agent.plugins").

Fix

Add entry-point scanning to both functions using the same importlib.metadata pattern as PluginManager._scan_entry_points():

  1. _plugin_exists(): check entry-point names before returning False
  2. _discover_all_plugins(): add entry-point plugins as source="entrypoint" after filesystem scan

Before vs After

Command Before After
hermes plugins list Only bundled + user dir plugins Also shows pip-installed entry-point plugins
hermes plugins enable <ep-plugin> "not installed or bundled" Works correctly
hermes plugins disable <ep-plugin> "not installed or bundled" Works correctly

Tests

  • Verified syntax with ast.parse()
  • Entry-point discovery logic matches PluginManager._scan_entry_points() exactly
  • Wrapped in try/except to match existing defensive pattern (graceful degradation if importlib.metadata unavailable)

Fixes #23802

The PluginManager.discover_and_load() correctly discovers pip-installed
plugins via importlib.metadata entry points (group=hermes_agent.plugins),
but the CLI management surfaces (_discover_all_plugins and _plugin_exists
in plugins_cmd.py) only scanned bundled and user filesystem directories.

This caused 'hermes plugins list' to omit entry-point plugins, and
'hermes plugins enable/disable' to reject them with 'not installed or
bundled' — even though the plugins loaded and worked correctly at runtime.

Fix: add entry-point scanning to both _plugin_exists() and
_discover_all_plugins(), using the same importlib.metadata pattern
as PluginManager._scan_entry_points().

Fixes NousResearch#23802
@tbaumann

Copy link
Copy Markdown

Thanks for the fix. I just stumbled over the same issue.

But, wouldn't it be better to call PluginManager instead of re-implementing the plugin discovery code in the plugins_cmd?
That way the different implementations would not drift apart again.

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 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.

hermes plugins enable/list filters out entry-point-discovered plugins

2 participants