Skip to content

fix(plugins): normalize nested bundled plugin aliases across plugin management flows#41613

Closed
mnajafian-nv wants to merge 4 commits into
NousResearch:mainfrom
mnajafian-nv:fix/plugins-list-nested-bundled-status-clean
Closed

fix(plugins): normalize nested bundled plugin aliases across plugin management flows#41613
mnajafian-nv wants to merge 4 commits into
NousResearch:mainfrom
mnajafian-nv:fix/plugins-list-nested-bundled-status-clean

Conversation

@mnajafian-nv

@mnajafian-nv mnajafian-nv commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Fix nested bundled plugin enablement state across hermes plugins list and plugin toggle flows such as observability/nemo_relay.

The runtime loader already supports both the path-derived plugin key and the legacy bare manifest name for back-compat. The CLI plugin-management path did not fully match that behavior, so nested bundled plugins could be discovered correctly but still show stale enabled/disabled state or report a successful toggle while mixed alias entries remained behind in config.

What Changed

  • Reused the runtime scanner model for plugin discovery so nested bundled plugins are listed with their path-derived keys.
  • Made CLI status and --enabled filtering honor both the path-derived key and the legacy bare manifest name.
  • Normalized enable / disable state updates through a shared nested-plugin alias resolver so CLI mutations clean up both aliases and store one canonical key.
  • Applied the same alias normalization to the dashboard plugin toggle path and the interactive composite plugin UI so dashboard and CLI behavior stay aligned.
  • Fixed stale nested-plugin tuple unpacking in the interactive toggle and dashboard remove paths after the shared discovery tuple grew a legacy-name field.
  • Added focused regressions for nested bundled plugin discovery, mixed alias state repair, interactive selection normalization, and dashboard plugin-management paths.

Validation

Passed:

  • bash scripts/run_tests.sh tests/hermes_cli/test_plugins_cmd_list.py tests/hermes_cli/test_plugin_scanner_recursion.py -- -q

Result:

  • 33 tests passed, 0 failed

Also ran:

  • scripts/run_tests.sh

The repo-wide wrapper currently reports unrelated failures outside this change scope. The focused plugin-management regressions above passed for this branch.

@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/cli CLI entry point, hermes_cli/, setup wizard comp/plugins Plugin system and bundled plugins labels Jun 8, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Duplicate of #41076 (same nested-plugin discovery fix for hermes plugins list, recurrence family of merged #27187). Near-identical to recently closed #41595 and overlaps #41081/#41066.

Signed-off-by: mnajafian-nv <mnajafian@nvidia.com>
@mnajafian-nv mnajafian-nv changed the title fix: align plugins list with nested bundled plugin enablement fix(plugins): normalize nested bundled plugin aliases across plugin management flows Jun 8, 2026
Signed-off-by: mnajafian-nv <mnajafian@nvidia.com>
@mnajafian-nv

mnajafian-nv commented Jun 8, 2026

Copy link
Copy Markdown
Contributor Author

Duplicate of #41076 (same nested-plugin discovery fix for hermes plugins list, recurrence family of merged #27187). Near-identical to recently closed #41595 and overlaps #41081/#41066.

Thanks for flagging this. I agree this overlaps #41076, so I’m going to close #41613 rather than keep a competing PR open.

One thing I do not believe #41076 covers is alias-normalized state mutation across the enable/disable flows. If that still matters after #41076 lands, I’m happy to address that remaining gap separately with a narrow follow-up.

kshitijk4poor added a commit to kshitijk4poor/hermes-agent that referenced this pull request Jun 8, 2026
…ble/disable (NousResearch#41066)

Salvage consolidating three complementary community PRs into one coherent fix:

- NousResearch#41076 (islam666): made `hermes plugins list` discover nested category
  plugins (e.g. `observability/nemo_relay`, `image_gen/openai`).
- NousResearch#41613 (mnajafian-nv): the superset — nested discovery aligned with the
  runtime loader (reuses `PluginManager._scan_directory`/`_scan_entry_points`
  so list state can't drift from what actually loads), PLUS the enable/disable
  mutation side NousResearch#41076 left flat.
- NousResearch#41081 (annguyenNous): identified the `web_server.py` dashboard plugins-hub
  caller of `_discover_all_plugins()`, which must also be updated for the new
  tuple shape + key-aware status.

This combines the best of all three and fixes the mutation-side gap that made
nested bundled plugins untoggleable:

    $ hermes plugins enable nemo_relay
    Plugin 'nemo_relay' is not installed or bundled.   # exit 1 (before)

Now `enable`/`disable`/`toggle`, the `hermes plugins list` views, the dashboard
plugins-hub endpoint, and the dashboard enable/disable helpers all resolve a
bare manifest name OR a full path-derived key to the canonical key the loader
gates on, via a single `_resolve_plugin_reference()` normalization point, and
persist that key while clearing any stale legacy bare-name alias so the two
can't drift. `_plugin_status` is key+legacy-name aware.

`_discover_all_plugins` now returns 6-tuples
`(key, legacy_name, version, description, source, dir_path)`; ALL call sites
(`cmd_list` table/plain/JSON, `_filter_plugin_entries`, `cmd_toggle`,
`dashboard_remove_user_plugin`, and `web_server._merged_plugins_hub`) and the
`test_plugins_cmd_list.py` fixtures are updated to match. Updating the
`web_server.py` caller prevents a `ValueError: too many values to unpack` crash
in the dashboard plugins-hub endpoint.

Verified e2e on the real CLI + runtime loader (isolated HERMES_HOME):
`hermes plugins enable nemo_relay` writes `observability/nemo_relay` to
config.yaml and the loader then loads it (`enabled=True, error=None`); a stale
bare-name alias is cleared on disable (no contradictory state); the dashboard
`_merged_plugins_hub()` runs and lists nested plugins by canonical key.
Full `tests/hermes_cli/test_plugins_cmd*` + web_server plugin tests green.

Closes NousResearch#41066. Supersedes NousResearch#41076, NousResearch#41081, and NousResearch#41613.

Co-authored-by: islam666 <islam666@users.noreply.github.com>
Co-authored-by: mnajafian-nv <mnajafian@nvidia.com>
Co-authored-by: annguyenNous <annguyenNous@users.noreply.github.com>
Co-authored-by: kshitijk4poor <82637225+kshitijk4poor@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard comp/plugins Plugin system and bundled plugins P3 Low — cosmetic, nice to have type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants