File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,10 +12,16 @@ jobs:
1212 - uses : actions/setup-python@v5
1313 with :
1414 python-version : " 3.11"
15+ - run : pip install pytest
1516 - run : python -m pytest -q
1617
1718 validate :
1819 runs-on : ubuntu-latest
20+ # The official action pip-installs hermes-agent from git, which its own
21+ # setup.py build guard refuses (pip/PyPI are unsupported distribution
22+ # methods upstream). Keep attempting (self-heals if upstream fixes the
23+ # action) but don't fail the build over it.
24+ continue-on-error : true
1925 steps :
2026 - uses : actions/checkout@v4
2127 - uses : NousResearch/hermes-agent/.github/actions/plugin-validate@main
Original file line number Diff line number Diff line change @@ -83,7 +83,14 @@ def _ensure_subscription_key() -> None:
8383 os .environ [ENV_VAR ] = key
8484
8585
86- _ensure_subscription_key ()
86+ def register (ctx ) -> None :
87+ """PluginManager entry point (also required by `hermes plugins validate`).
88+
89+ Provider registration already happened at import; re-run the key ensure
90+ so a login that arrived after import is picked up. Stdlib-only, so the
91+ admission probe can run it in a bare interpreter.
92+ """
93+ _ensure_subscription_key ()
8794
8895
8996if _HERMES_AVAILABLE :
Original file line number Diff line number Diff line change @@ -171,3 +171,11 @@ def test_importable_without_hermes_runtime():
171171 assert module ._fetch_omp_subscription_key () == "" or isinstance (
172172 module ._fetch_omp_subscription_key (), str
173173 )
174+
175+ def test_register_entry_point_is_probe_safe ():
176+ """`hermes plugins validate` requires register() and runs it in a bare
177+ interpreter: it must exist, take any ctx, and never raise."""
178+ module , _ = _load_plugin (env = {"MUSE_CODE_SUB_TOKEN" : "pinned" })
179+ assert callable (getattr (module , "register" , None ))
180+ module .register (object ())
181+ assert os .environ ["MUSE_CODE_SUB_TOKEN" ] == "pinned"
You can’t perform that action at this time.
0 commit comments