Skip to content

fix(cli): discover pip-installed plugins via entry points in list/enable/disable - #34533

Closed
annguyenNous wants to merge 1 commit into
NousResearch:mainfrom
annguyenNous:fix/cli-plugin-entrypoint-discovery
Closed

fix(cli): discover pip-installed plugins via entry points in list/enable/disable#34533
annguyenNous wants to merge 1 commit into
NousResearch:mainfrom
annguyenNous:fix/cli-plugin-entrypoint-discovery

Conversation

@annguyenNous

Copy link
Copy Markdown
Contributor

Problem

The runtime PluginManager.discover_and_load() scans importlib.metadata entry points (hermes_agent.plugins group) to find pip-installed plugins, but the CLI commands (hermes plugins list, enable, disable) only scanned bundled and user filesystem directories.

This caused pip-installed plugins to be invisible in CLI output and impossible to enable/disable by name, even though they loaded correctly at runtime. Users installing platform adapters (discord, mattermost, etc.) via pip install hermes-agent[discord] would see No adapter available for discord in hermes gateway run but couldn't diagnose via hermes plugins list because the plugin didn't appear.

Fix

Add entry-point scanning to both _discover_all_plugins() and _plugin_exists() in hermes_cli/plugins_cmd.py:

  1. _discover_all_plugins() — After scanning bundled and user directories, also check importlib.metadata.entry_points(group="hermes_agent.plugins") and add any entries not already found via filesystem scan.

  2. _plugin_exists() — After checking bundled and user directories, also check entry points so hermes plugins enable <name> works for pip-installed plugins.

Both additions use the same entry-point selection pattern as PluginManager._scan_entry_points() (Python 3.12+ select() / dict fallback / list comprehension), wrapped in try/except Exception for graceful degradation.

Before vs After

Command Before After
hermes plugins list Only bundled + user dir plugins Also shows pip-installed entry-point plugins
hermes plugins enable discord Plugin 'discord' not found Works if pip-installed with entry point
hermes plugins info discord Not found Shows entry-point plugin info

Tests

No new tests added — the fix is mechanical (adds a discovery source that already exists in the runtime loader). Existing plugin CLI tests should continue to pass since the change is additive.

Fixes #34511 (related — same class of discovery gap, though that specific issue was about missing plugin.yaml manifests in the PyPI wheel).

…ble/disable

The runtime PluginManager.discover_and_load() scans importlib.metadata
entry points (hermes_agent.plugins group) to find pip-installed plugins,
but the CLI commands (hermes plugins list, enable, disable) only scanned
bundled and user filesystem directories. This caused pip-installed
plugins to be invisible in CLI output and impossible to enable/disable
by name, even though they loaded correctly at runtime.

Add entry-point scanning to both _discover_all_plugins() and
_plugin_exists() so CLI discovery matches runtime discovery.

Fixes the class of bugs where a pip-installed platform adapter (e.g.
discord, mattermost) works at runtime but doesn't appear in
'hermes plugins list' or respond to 'hermes plugins enable'.
@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 labels May 29, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Duplicate of #23802 (root issue) — competing with existing PR #23814 (same fix, same scope). Closed PR #25040 was a broader attempt at the same fix. All target hermes_cli/plugins_cmd.py to add importlib.metadata.entry_points() scanning.

@teknium1

Copy link
Copy Markdown
Contributor

already impl

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.

[Bug]: Discord gateway adapter not registered/discovered in PyPI v0.15.1

3 participants