fix(plugins): include entry-point plugins in hermes plugins list/enable/disable (#23802) - #25040
Closed
wesleysimplicio wants to merge 3 commits into
Conversation
…leton Closes NousResearch#24714 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…e source When removing one of multiple credentials that share the same source tag (e.g. manual:device_code from repeated `hermes auth add openai-codex`), the previous unconditional suppress_credential_source() call would silently mark that source as suppressed even though the surviving entries still depended on it. On the next load_pool(), any code path gating on is_source_suppressed() would drop those healthy survivors. Fix: only suppress when pool.entries() shows no remaining entry with the same source after the removal. Also strip misleading "will not be re-seeded" hints when suppression is intentionally skipped. Fixes NousResearch#24390 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…le/disable `_discover_all_plugins()` and `_plugin_exists()` only scanned on-disk manifest directories (bundled + user ~/.hermes/plugins/). Plugins installed via `pip install <package>` that register via the `hermes_agent.plugins` entry-point group were silently invisible to both surfaces. Root cause: neither helper consulted `importlib.metadata.entry_points()`. The PluginManager itself scans entry points via `_scan_entry_points()` and loads them correctly, but the management CLI layer had no equivalent scan. Fix: add entry-point scan to both helpers using the same `importlib.metadata.entry_points()` logic as `_scan_entry_points()`. Bundled/user directory plugins take precedence on name collision. Entry-point results carry `source="entrypoint"` and `path=None`. Fixes NousResearch#23802 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
Contributor
Author
|
Closing as a duplicate/competing PR with #23814, per review feedback. The competing PR already covers the entry-point plugin discovery behavior and is the clearer single source of truth for this fix. |
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 list,hermes plugins enable <name>, andhermes plugins disable <name>silently ignore plugins installed viapip install <package>that register through thehermes_agent.pluginsentry-point group.Root cause
hermes plugins list,hermes plugins enable <name>, andhermes plugins disable <name>silently ignore plugins installed viapip install <package>that register through thehermes_agent.pluginsentry-point group.A pip-installed plugin works (the
PluginManagerdiscovers and loads it), but it is invisible to every management surface.Fix
Add the same
importlib.metadata.entry_points()scan to both helpers.Bundled/user directory plugins take precedence on name collision. Entry-point results carry
source="entrypoint"andpath=None(which all callers already handle with_path/_dunused positional names).Why this shape
This shape mirrors #29640 so reviewers can quickly compare scope, root cause, fix, tests, and related context without having to decode a custom PR description.
Tests
Original body
Related PRs / issues
Fixes #23802
Original body
Summary
hermes plugins list,hermes plugins enable <name>, andhermes plugins disable <name>silently ignore plugins installed viapip install <package>that register through thehermes_agent.pluginsentry-point group.What Changed
Fluxo
A mudança continua seguindo o fluxo original descrito na seção preservada abaixo, sem ampliar o escopo funcional deste PR.
Visão
A padronização melhora a revisão, reduz ruído e evita deriva de formatação entre PRs abertos.
Test Plan
Original body
What does this PR do?
Problem
hermes plugins list,hermes plugins enable <name>, andhermes plugins disable <name>silently ignore plugins installed viapip install <package>that register through thehermes_agent.pluginsentry-point group.A pip-installed plugin works (the
PluginManagerdiscovers and loads it), but it is invisible to every management surface.Root Cause
_discover_all_plugins()and_plugin_exists()inhermes_cli/plugins_cmd.pyonly scan on-disk manifest directories (bundledplugins/<name>/and user~/.hermes/plugins/<name>/). Neither helper callsimportlib.metadata.entry_points(). ThePluginManager._scan_entry_points()method has the correct logic, but the CLI management layer was never wired to it.Fix
Add the same
importlib.metadata.entry_points()scan to both helpers.Bundled/user directory plugins take precedence on name collision. Entry-point results carry
source="entrypoint"andpath=None(which all callers already handle with_path/_dunused positional names).Flow
graph TD A[hermes plugins list] --> B[_discover_all_plugins] B --> C[scan bundled dir] B --> D[scan user dir] B --> E[NEW: scan entry_points] E --> F[ep.name not in seen → add with source=entrypoint] C & D --> G[user overrides bundled on collision] G & F --> H[return list]Tests
test_discover_includes_entrypoint_plugin— entry-point plugin appears in results withsource="entrypoint"andpath=Nonetest_discover_entrypoint_does_not_override_bundled— bundled plugin with same name winstest_plugin_exists_true_for_entrypoint—_plugin_exists()returns True for entry-point plugintest_plugin_exists_false_for_unknown_entrypoint— returns False for unknown name even when other entry-points existAll 129
test_plugins_cmd.py+test_plugins.pytests green.🤖 Generated with Claude Code
Solution Sketch
Related Issue
Fixes #23802
Type of Change
Changes Made
.github/PULL_REQUEST_TEMPLATE.mdHow to Test
Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) — or N/Acli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/AScreenshots / Logs
Generated by Hermes Turbo
Generated by Hermes Turbo