Repository navigation
fix(plugins): validate accepts the legacy hooks: manifest key the loader reads - #141340
Open
simin-yuan wants to merge 1 commit into
Open
simin-yuan wants to merge 1 commit into
simin-yuan wants to merge 1 commit into
Conversation
simin-yuan
force-pushed
the
fix/validate-legacy-hooks-key
branch
from
October 19, 2026 08:43
ce2172b to
c5e6064
Compare
…der reads The loader resolves declared hooks from provides_hooks and falls back to the legacy hooks: key (NousResearch#108371), but `hermes plugins validate` only read provides_hooks. An external plugin declaring its hooks under hooks: loaded fine yet failed admission with "undeclared hooks registered (not in provides_hooks)". Move the resolution into plugins_manifest.hooks_manifest_key() and use it in both the loader and the validator. When only the legacy key is present, validate passes with a warning recommending provides_hooks.
simin-yuan
force-pushed
the
fix/validate-legacy-hooks-key
branch
from
October 21, 2026 05:11
c5e6064 to
341b152
Compare
simin-yuan
force-pushed
the
fix/validate-legacy-hooks-key
branch
from
November 6, 2026 21:17
341b152 to
6f2f786
Compare
This branch has not been deployed
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?
The loader reads declared hooks from
provides_hooksand falls back to the legacyhooks:key (#108371).hermes plugins validateread onlyprovides_hooks, so an external plugin usinghooks:loaded fine but failed validation with "undeclared hooks registered (not in provides_hooks)".This PR moves the resolution rule into
hermes_cli.plugins_manifest.hooks_manifest_key(), and both the loader and the validator use it. Loader behaviour is unchanged. When only the legacy key is present, validation passes and adds a warning recommendingprovides_hooks. Theprovides_toolsandprovides_middlewarechecks and the bundled manifests are untouched. The second commit maps my contributor email, which the contributor check requires.Related Issue
Fixes #141339
Type of Change
Changes Made
hermes_cli/plugins_manifest.py— newhooks_manifest_key(data):provides_hooks, else the legacyhooks:list, else the default.hermes_cli/plugin_validate.py— the "declared hooks" check resolves the key through that helper instead of readingprovides_hooksdirectly; a legacy-only manifest passes and gets a warning.tests/hermes_cli/test_plugin_validate.py—test_legacy_hooks_key_declares_hooks_like_the_loadercovers the loader-equal path.contributors/emails/[email protected]— contributor email mapping.The loader path in
hermes_cli/plugins_manifest.pynow calls the same helper, so the two sides cannot drift again.How to Test
scripts/run_tests.sh tests/hermes_cli/test_plugin_validate.py: the new testtest_legacy_hooks_key_declares_hooks_like_the_loaderfails on main and passes with this change.hermes plugins validateon a plugin whoseplugin.yamllists its hooks underhooks:. The "declared hooks" check passes and a warning recommendsprovides_hooks.python scripts/checkpasses.Platforms tested: Linux and Windows.
Note on the test file:
tests/hermes_cli/test_plugin_validate.pyalso containstest_portable_validation_fails_orphan_and_reports_availability, which fails identically on unmodified main in my local environment (a missing optional dependency); it is unrelated to this change and was failing before it.Checklist
Code
fix(plugins):,chore:)pytest tests/ -qand all tests pass — run for the touched file instead: 27 passed, plus the one pre-existing failure described above that also fails on main. I am not claiming a green full suite from this machine.python scripts/checkpasses (the blocking lint and code-health checks CI runs) —python scripts/check --commit HEAD --base upstream/main: 12 checks, okDocumentation & Housekeeping
docs/, docstrings) — or N/A (the warning message itself tells the author to useprovides_hooks)cli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/AScreenshots / Logs