Skip to content

fix(nix): load google_chat platform under Nix - #27077

Closed
milanglacier wants to merge 1 commit into
NousResearch:mainfrom
milanglacier:fix-nix-bundled-platform-scan
Closed

milanglacier wants to merge 1 commit into
NousResearch:mainfrom
milanglacier:fix-nix-bundled-platform-scan

Conversation

@milanglacier

@milanglacier milanglacier commented May 16, 2026 •

Copy link
Copy Markdown

Problem

When starting hermes gateway under nix, get this warning:

WARNING hermes_cli.plugins: Failed to load plugin 'google_chat-platform': 'google_chat' is not a valid Platform

Summary

  • honor HERMES_BUNDLED_PLUGINS when scanning bundled gateway platform plugins
  • allow Platform("google_chat") to resolve before the Google Chat adapter imports under Nix packaging
  • keep the existing repo-relative plugins/platforms fallback for development checkouts

Verification

  • .venv/bin/python direct regression check for a Nix-like HERMES_BUNDLED_PLUGINS plugin tree

Honor HERMES_BUNDLED_PLUGINS when scanning bundled platform plugins so google_chat resolves before adapter import in packaged installs.
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists area/nix Nix flake, NixOS module, container packaging comp/gateway Gateway runner, session dispatch, delivery labels May 16, 2026
@cardtest15-coder

This comment was marked as spam.

@teknium1

teknium1 commented Jun 13, 2026 •

Copy link
Copy Markdown
Collaborator

Thanks for the targeted Nix fix. I verified the premise against the current checkout: gateway/config.py:217 still scans only the repo-relative plugins/platforms path, while hermes_cli/plugins.py:55-65 and nix/hermes-agent.nix:180 already use HERMES_BUNDLED_PLUGINS for bundled plugin discovery. The failure path is also real: plugins/platforms/google_chat/adapter.py:119 imports Platform and plugins/platforms/google_chat/adapter.py:129 calls Platform("google_chat") during plugin import, and hermes_cli/plugins.py:1589-1593 logs the reported “Failed to load plugin” warning when import raises.

Problems

  • No regression test is included for the new packaged-path branch: gh pr diff 27077 --name-only shows only gateway/config.py, so CI would not guard HERMES_BUNDLED_PLUGINS platform discovery.

Suggested changes

  • Add a focused test near tests/gateway/test_google_chat.py:25-28 or a gateway config test that sets HERMES_BUNDLED_PLUGINS to a temporary plugins/platforms/google_chat tree, resets the Platform bundled-name cache, and asserts Platform("google_chat") resolves before adapter registration.

This is an automated hermes-sweeper review.

@teknium1 teknium1 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the focused Nix packaging fix. The premise still holds on current main: gateway/config.py:290-308 scans only the repository-relative plugins/platforms, while the Nix wrapper exports the installed tree through HERMES_BUNDLED_PLUGINS at nix/hermes-agent.nix:166-180. The proposed resolution matches the established loader behavior in hermes_cli/plugins.py:55-65.

Problems

  • The PR changes the dynamic-enum discovery path without a regression test. tests/gateway/test_google_chat.py:23-28 resolves Platform("google_chat"), but does not exercise a Nix-style HERMES_BUNDLED_PLUGINS directory or reset the scanner cache.

Suggested changes

  • Add a focused test using a temporary plugins/platforms/google_chat manifest tree, set HERMES_BUNDLED_PLUGINS, clear _Platform__bundled_plugin_names, and assert Platform("google_chat") resolves before adapter import. Cover the unset override retaining repository-relative discovery as well.

This is an automated hermes-sweeper review.

Comment thread gateway/config.py
Keep this scanner aligned with the main plugin loader so dynamic
platform enum members are available before plugin adapters import.
"""
names: set = set()

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a regression test for this packaged-path branch: create a temporary plugins/platforms/google_chat manifest tree, set HERMES_BUNDLED_PLUGINS, reset the module-level bundled-name cache, and assert Platform("google_chat") resolves before adapter import.

@teknium1 teknium1 added sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform labels Jul 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/nix Nix flake, NixOS module, container packaging comp/gateway Gateway runner, session dispatch, delivery P2 Medium — degraded but workaround exists sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants