fix(plugins): show entry-point plugins in 'hermes plugins list' (#58644) - #59234
Closed
iacker wants to merge 1 commit into
Closed
fix(plugins): show entry-point plugins in 'hermes plugins list' (#58644)#59234iacker wants to merge 1 commit into
iacker wants to merge 1 commit into
Conversation
_discover_all_plugins() (the display path for 'hermes plugins list') scanned only bundled and user directories, so pip-installed plugins registered via the hermes_agent.plugins entry-point group were loaded and active but invisible in the listing (--json and --plain included). Reuse the loader's PluginManager._scan_entry_points() instead of duplicating the importlib.metadata logic. Entry-point plugins have no directory, so their tuple carries dir_path=None; the render, filter, and resolve paths already ignore that element, so listing/JSON/enable all work. setdefault keeps directory plugins winning on key collision, matching discover_and_load() precedence.
Collaborator
Duplicate of #23814 (earliest-open canonical) — same fix: mirror |
Contributor
Author
|
Closing as duplicate of #23814 per triage bot — canonical PR addresses the same issue. |
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.
What does this PR do?
hermes plugins listdid not show pip-installed plugins registered via thehermes_agent.pluginsentry-point group. Those plugins are loaded andactive (the real loader
PluginManager.discover_and_load()scans entrypoints) — they were just invisible in the listing, including
--jsonand--plainoutput.Root cause: two separate discovery paths. The loader scans directories and
entry points; the display helper
_discover_all_plugins()inhermes_cli/plugins_cmd.pyscanned only bundled + user directories.Related Issue
Fixes #58644
Type of Change
Changes Made
hermes_cli/plugins_cmd.py—_discover_all_plugins()now also scansentry-point plugins by reusing
PluginManager._scan_entry_points()(rather than duplicating the
importlib.metadatalogic). Entry-pointplugins have no directory, so their tuple carries
dir_path=None; therender, filter, and resolve paths already ignore that element.
setdefaultkeeps directory plugins winning on key collision, matching
discover_and_load()precedence.tests/hermes_cli/test_plugins_cmd_list.py— regression test asserting anentry-point plugin surfaces in the display path and resolves for
enable/disable, with
dir_path=None.How to Test
Reproduce (before fix): a pip plugin registering a
hermes_agent.pluginsentry point (e.g.
rtk-hermes) is loaded and rewriting commands, but absentfrom
hermes plugins list/--json/--plain.Automated:
The new
test_discover_all_plugins_includes_entry_pointsfails onmain(entry points never reach the display path) and passes with this change.
Checklist
Code
plugins_cmdsuites)Documentation & Housekeeping