Skip to content

feat(providers): discover pip-installed model providers via entry points (salvage #81419) - #85504

Merged
teknium1 merged 2 commits into
mainfrom
salvage/pr-81419-pip-providers
Aug 13, 2026
Merged

feat(providers): discover pip-installed model providers via entry points (salvage #81419)#85504
teknium1 merged 2 commits into
mainfrom
salvage/pr-81419-pip-providers

Conversation

@teknium1

Copy link
Copy Markdown
Contributor

Summary

pip installed model-provider plugins now register their providers and show their models in the registry, matching filesystem-plugin behavior — gated by the same plugins.enabled opt-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 the hermes_agent.plugins group in _discover_providers(); supports module:func callables and self-registering bare modules (contributor's work). Follow-up hardening:
    • honors plugins.enabled allow-list / plugins.disabled deny-list — installed ≠ loaded
    • skips callables that require arguments, so register(ctx)-style general plugins sharing the group are never invoked (no TypeError warning spam)
    • discovered FIRST → lowest precedence: last-writer-wins means bundled/$HERMES_HOME profiles always beat a pip impostor on name collision
  • tests/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 docstring
  • website/docs/developer-guide/model-provider-plugin.md: corrected mechanism wording, documented the config gate with a plugins.enabled example

Validation

Check Result
tests/providers/ (56 tests) pass
E2E: real pip-built package (pip install --target), temp HERMES_HOME not enabled → skipped; enabled → registered; deny-list → skipped

Infographic

PIP providers via entry points

albertodepaola and others added 2 commits August 13, 2026 10:51
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.
@github-actions

github-actions Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

૮ >ﻌ< ა ci review

ran on c7f3e2b — fix: gate entry-point provider scan on plugins.enabled and s

⚠️ Warnings

OSV vulnerability scan · View job

5 known vulnerabilities found in pinned dependencies.

How to fix:

Review the findings in the Security tab. Update the affected dependencies if a patched version is available.


debug info

CI timings

CI timings · View report · View job

Wall time 3m20s vs 6m24s (-47.9%). 12 job(s) slower, 11 faster, 2 unchanged.

  • Python tests / Run tests slice 9/12: -40.0s
  • Python tests / Run tests slice 7/12: +32.0s
  • Python tests / Run tests slice 6/12: +25.0s
  • Python tests / Run tests slice 3/12: +21.0s
  • OS-specific tests / macOS-only tests: -8.0s

@alt-glitch alt-glitch added type/feature New feature or request comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint comp/plugins Plugin system and bundled plugins P3 Low — cosmetic, nice to have labels Aug 13, 2026
@teknium1
teknium1 merged commit 69b27e3 into main Aug 13, 2026
48 checks passed
@teknium1
teknium1 deleted the salvage/pr-81419-pip-providers branch August 13, 2026 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint comp/plugins Plugin system and bundled plugins P3 Low — cosmetic, nice to have type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants