Skip to content

Hermes plugin: add the register(ctx) entry point the plugin catalog requires - #6

Open
MaxFreedomPollard wants to merge 1 commit into
mainfrom
hermes-plugin-register-entry-point
Open

Hermes plugin: add the register(ctx) entry point the plugin catalog requires#6
MaxFreedomPollard wants to merge 1 commit into
mainfrom
hermes-plugin-register-entry-point

Conversation

@MaxFreedomPollard

Copy link
Copy Markdown
Owner

What

Adds the register(ctx) plugin entry point to the Hermes memory-provider plugin (both shipped copies: integrations/hermes/compartment/__init__.py and the wheel's src/compartment/data/hermes-plugin/__init__.py, kept byte-identical), plus a test that loads each copy the way Hermes does and checks the registration.

Why

Hermes now discovers out-of-tree plugins through the Nous-approved, SHA-pinned plugin catalog (plugin-catalog/*.yaml in NousResearch/hermes-agent, landed 9 Sep in NousResearch/hermes-agent#69446). Its admission gate runs hermes plugins validate against the pinned commit, and that probe imports the plugin in a bare interpreter and calls register(ctx); without the function the entry fails with capability probe — no register() function. Verified against a Hermes checkout at 45a6101f:

Plugin as shipped (v4.9.6) With this change
✗ capability probe — no register() function ✓ capability probe — register() ran in isolation (10/10 checks pass, no warnings)

The function is the documented memory-provider entry point (Hermes developer guide, "Plugin Entry Point"): Hermes's memory loader calls register(ctx) first and falls back to scanning for a MemoryProvider subclass, so existing installs keep working unchanged. With the plugin dropped into $HERMES_HOME/plugins/compartment/, hermes memory setup still lists compartment as "no setup needed" (checked against the same Hermes checkout).

Once this ships in a release, the catalog entry (plugin-catalog/compartment.yaml, pinned to that release's commit) can be submitted; that gives hermes plugins install compartment and puts Compartment in the memory-provider picker without any change to Hermes core.

Tests

  • New tests/test_hermes_plugin_register.py (4 tests): register hands a CompartmentMemoryProvider (name compartment, empty config schema) to the context for both copies, and registering never imports the compartment package.
  • Full suite with COMPARTMENT_ASSERT_OFFLINE=1 (dash tests deselected): 940 passed, 6 skipped, 0 failed, 3 min on macOS / Python 3.12.

…equires

Hermes's memory loader calls register(ctx) first and falls back to scanning
for a MemoryProvider subclass, so existing installs are unchanged. The Nous
plugin catalog's admission probe (`hermes plugins validate`) has no
fallback: it imports the plugin in a bare interpreter and fails with "no
register() function" without it. Both shipped copies carry the function,
byte-identical, and a test loads each the way Hermes does.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants