Repository navigation
fix(plugins): skip foreign-harness manifest dirs during discovery - #101977
liuhao1024 wants to merge 1 commit into
Conversation
Multi-harness plugin repos (e.g. obra/superpowers) ship one plugin.json per OTHER agent harness inside .claude-plugin/, .codex-plugin/, .cursor-plugin/, .devin-plugin/ and .kimi-plugin/. Those manifests can never satisfy the Agent Plugins v1 schema, so every discovery pass rejected each one and logged a warning — ~1,500 warnings/day on the reporter's install (NousResearch#101962). Skip these well-known per-harness convention directories during directory scanning. A plugin's real Hermes manifest (.hermes-plugin/plugin.yaml or a top-level plugin.yaml/plugin.json) is unaffected, and genuinely broken portable manifests still warn. Fixes NousResearch#101962
Overall: Plugin discovery skips foreign-harness manifest dirs ( Correctness:
Non-blocking nits:
Verdict: LGTM. Surgical noise fix with the safety case tested. |
|
Thanks — the explicit set is deliberate over a pattern, since it cannot accidentally skip a real Hermes manifest dir; the maintenance note stands. |
|
Thanks @liuhao1024 — cherry-picked (re-sited onto Salvaged into #118841 with your authorship preserved (merge 74f726c). Thank you! |
What does this PR do?
Multi-harness plugin repos (e.g. obra/superpowers) ship one
plugin.jsonper other agent harness inside.claude-plugin/,.codex-plugin/,.cursor-plugin/,.devin-plugin/and.kimi-plugin/. Those manifests are per-harness conventions and can never satisfy the Agent Plugins v1$schema, so every plugin-discovery pass tried each one, rejected it, and logged a warning — on the reporter's install that is 5 warnings per discovery cycle, ~1,500/day inerrors.log.This PR makes directory discovery skip these well-known foreign-harness manifest directories (option 1 from the issue). A plugin's real Hermes manifest (
.hermes-plugin/plugin.yamlor a top-levelplugin.yaml/plugin.json) is unaffected, and a genuinely broken portableplugin.jsonoutside these convention directories still surfaces its parse warning.Related Issue
Fixes #101962
Type of Change
Changes Made
hermes_cli/plugins.py: added_FOREIGN_HARNESS_MANIFEST_DIRS(.claude-plugin,.codex-plugin,.cursor-plugin,.devin-plugin,.kimi-plugin) and skip these directory names at any scan depth in_scan_directory_level, with a DEBUG log explaining the skip. No functional change: thoseplugin.jsonfiles could never validate, so nothing that was loadable before is lost.tests/hermes_cli/test_plugin_scanner_recursion.py: regression tests — a superpowers-style layout produces zeroFailed to parsewarnings while the real.hermes-plugin/plugin.yamlis still discovered; a genuinely broken portableplugin.jsonstill warns.How to Test
python -m pytest tests/hermes_cli/test_plugin_scanner_recursion.py -q— 14 passed (12 existing + 2 new).python -m pytest tests/hermes_cli/ -q -k plugin— 625 passed, 1 unrelated pre-existing failure (test_relay_shared_metrics_runtime.py, fails identically on cleanupstream/main;nemo_relaymodule issue, unrelated to plugin scanning).~/.hermes/plugins/superpowers/{.hermes-plugin,.claude-plugin,.codex-plugin,.cursor-plugin,.devin-plugin,.kimi-plugin}with aplugin.yamlin the first and a schema-lessplugin.jsonin each of the others, then run discovery. Observed result: before the fix, 5 ×WARNING hermes_cli.plugins: Failed to parse ...: plugin.json declares an unsupported or missing Agent Plugins schemaper pass; after the fix, 0 warnings andsuperpowers/.hermes-pluginstill discovered.Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) — or N/Acli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/AFor New Skills
N/A — not a skill.
Screenshots / Logs
Before (per discovery pass, ×5 dirs):
After: no warnings; discovery debug log shows
Skipping .../superpowers/.claude-plugin (foreign-harness manifest convention).