Hermes plugin: add the register(ctx) entry point the plugin catalog requires - #6
Open
MaxFreedomPollard wants to merge 1 commit into
Open
Hermes plugin: add the register(ctx) entry point the plugin catalog requires#6MaxFreedomPollard wants to merge 1 commit into
MaxFreedomPollard wants to merge 1 commit into
Conversation
…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 Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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
Adds the
register(ctx)plugin entry point to the Hermes memory-provider plugin (both shipped copies:integrations/hermes/compartment/__init__.pyand the wheel'ssrc/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/*.yamlinNousResearch/hermes-agent, landed 9 Sep in NousResearch/hermes-agent#69446). Its admission gate runshermes plugins validateagainst the pinned commit, and that probe imports the plugin in a bare interpreter and callsregister(ctx); without the function the entry fails withcapability probe — no register() function. Verified against a Hermes checkout at45a6101f:✗ 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 aMemoryProvidersubclass, so existing installs keep working unchanged. With the plugin dropped into$HERMES_HOME/plugins/compartment/,hermes memory setupstill listscompartmentas "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 giveshermes plugins install compartmentand puts Compartment in the memory-provider picker without any change to Hermes core.Tests
tests/test_hermes_plugin_register.py(4 tests):registerhands aCompartmentMemoryProvider(namecompartment, empty config schema) to the context for both copies, and registering never imports thecompartmentpackage.COMPARTMENT_ASSERT_OFFLINE=1(dash tests deselected): 940 passed, 6 skipped, 0 failed, 3 min on macOS / Python 3.12.