fix: include entry-point plugins in CLI list/enable/disable commands#23814
Open
vanthinh6886 wants to merge 1 commit into
Open
fix: include entry-point plugins in CLI list/enable/disable commands#23814vanthinh6886 wants to merge 1 commit into
vanthinh6886 wants to merge 1 commit into
Conversation
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
Closed
19 tasks
|
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? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
hermes plugins listandhermes plugins enable/disabledo not show pip-installed entry-point plugins, even thoughPluginManager.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 listomits ithermes plugins enable <name>returns "Plugin '' is not installed or bundled"Root Cause
_discover_all_plugins()and_plugin_exists()inhermes_cli/plugins_cmd.pyonly scan two filesystem directories (bundled + user), whilePluginManager.discover_and_load()inplugins.pyhas a 4th discovery source:importlib.metadata.entry_points(group="hermes_agent.plugins").Fix
Add entry-point scanning to both functions using the same
importlib.metadatapattern asPluginManager._scan_entry_points():_plugin_exists(): check entry-point names before returning False_discover_all_plugins(): add entry-point plugins as source="entrypoint" after filesystem scanBefore vs After
hermes plugins listhermes plugins enable <ep-plugin>hermes plugins disable <ep-plugin>Tests
ast.parse()PluginManager._scan_entry_points()exactlyFixes #23802