feat(providers): discover pip-installed model providers via entry points (salvage #81419) - #85504
Merged
Conversation
Model-provider discovery was filesystem-only (bundled dir, $HERMES_HOME, legacy providers/*.py). The general PluginManager scans the hermes_agent.plugins entry-point group but deliberately does NOT import kind=model-provider manifests (providers/ owns their lifecycle), so a pip-installed provider was recorded yet never called register_provider() — it never appeared in the picker, contradicting the 'Distribute via pip' docs. Add a _discover_entry_point_providers() step that scans the hermes_agent.plugins group and imports each entry, supporting both a module:func callable target and a bare self-registering module target. - Runs BEFORE filesystem plugins (lowest precedence): last-writer-wins means bundled/$HERMES_HOME profiles always override a pip provider of the same name, so a third-party package cannot hijack a first-party provider id. - Per-entry failures are isolated (logged + skipped), so one broken package can't break discovery. - Docs updated to describe the real mechanism; tests cover callable + module targets, failure isolation, and first-party precedence.
…ter(ctx) targets Follow-ups on salvaged #81419: - Honor the plugins.enabled allow-list / plugins.disabled deny-list (same opt-in contract as the general PluginManager) — installed != loaded. - Skip callables that require arguments: general plugins share the hermes_agent.plugins group with register(ctx) targets; invoking them zero-arg would TypeError-spam every startup. - Fix test docstring (entry points are discovered FIRST, lowest precedence) and docs mechanism wording; document the config gate. - New tests: opt-in gate, deny-list, register(ctx) never invoked. E2E-verified with a real pip-built package against a temp HERMES_HOME.
Contributor
૮ >ﻌ< ა ci reviewran on c7f3e2b — fix: gate entry-point provider scan on plugins.enabled and s
|
This was referenced Aug 13, 2026
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.
Summary
pip installed model-provider plugins now register their providers and show their models in the registry, matching filesystem-plugin behavior — gated by the sameplugins.enabledopt-in the general PluginManager enforces.Salvages #81419 by @albertodepaola (cherry-picked, authorship preserved) with hardening on top.
Changes
providers/__init__.py: new step-0 entry-point scan of thehermes_agent.pluginsgroup in_discover_providers(); supportsmodule:funccallables and self-registering bare modules (contributor's work). Follow-up hardening:plugins.enabledallow-list /plugins.disableddeny-list — installed ≠ loadedregister(ctx)-style general plugins sharing the group are never invoked (no TypeError warning spam)$HERMES_HOMEprofiles always beat a pip impostor on name collisiontests/providers/test_entry_point_discovery.py: contributor's 3 tests + 3 new (opt-in gate, deny-list wins,register(ctx)never invoked); fixed inverted precedence docstringwebsite/docs/developer-guide/model-provider-plugin.md: corrected mechanism wording, documented the config gate with aplugins.enabledexampleValidation
tests/providers/(56 tests)pip install --target), temp HERMES_HOMEInfographic