From 769e53745730e6f3ea915be346c2c7c904a8dcff Mon Sep 17 00:00:00 2001 From: zhanghui Date: Fri, 13 Nov 2026 13:44:24 +0800 Subject: [PATCH 1/2] fix(hermes): keep EverOS auto-start working on Hermes 2026.9.7+ Since 2026.9.7 Hermes loads memory providers through the shared plugin loader, which setattr()s every sibling module onto the package after __init__ runs. The package global `provision` (the function, imported from provision.py) was replaced by the provision module, so the startup thread raised `TypeError: 'module' object is not callable`: with EverOS down, nothing started it, and recall and capture failed silently. With EverOS already running everything worked, which is why it went unnoticed. Bind the function as `provision_everos` instead. The file keeps its name so re-running the install over an old copy cannot leave a stale module behind. A test pins the invariant: no package global may share a sibling module's name. Verified with the real loader: on v0.23.1 the start command runs again (it did not before the fix), on the 2026-08-07 baseline it still runs, and the full provider probe on v0.23.1 (search, add with tool calls, flush) passes. Also corrects the README install path, which is $HERMES_HOME/plugins/everos. Co-Authored-By: Claude Opus 5.5 --- hermes/README.md | 2 +- hermes/__init__.py | 7 +++++-- hermes/plugin.yaml | 2 +- hermes/tests/test_core.py | 18 ++++++++++++++++++ hermes/tests/test_provider.py | 18 +++++++++--------- 5 files changed, 34 insertions(+), 13 deletions(-) diff --git a/hermes/README.md b/hermes/README.md index 4053f2b..cd122d6 100644 --- a/hermes/README.md +++ b/hermes/README.md @@ -13,7 +13,7 @@ Design details: [`docs/DESIGN_DOC.md`](./docs/DESIGN_DOC.md) · build/test/relea ## Install ```bash -hermes plugins install EverMind-AI/plugins/hermes # → ~/.hermes/plugins/memory/everos/ +hermes plugins install EverMind-AI/plugins/hermes # → $HERMES_HOME/plugins/everos/ hermes memory setup # pick "everos"; answer the prompts hermes memory status # verify: provider active, EverOS healthy ``` diff --git a/hermes/__init__.py b/hermes/__init__.py index 7c36d8d..57a4307 100644 --- a/hermes/__init__.py +++ b/hermes/__init__.py @@ -22,7 +22,10 @@ from unicodedata import east_asian_width from .client import ADD_MAX_MESSAGES, EverosClient, EverosError -from .provision import provision, stop_child +# Bound under another name: Hermes >= 2026.9.7 setattr()s every sibling module onto the +# package after this file runs, which would replace a global named `provision`. +from .provision import provision as provision_everos +from .provision import stop_child try: # the real ABC exists inside a Hermes runtime from agent.memory_provider import MemoryProvider @@ -479,7 +482,7 @@ def initialize(self, session_id: str, **kwargs: Any) -> None: client, cfg = self._client, self._cfg def _provision() -> None: - result = provision(client, cfg.start_cmd, cfg.everos_dir) + result = provision_everos(client, cfg.start_cmd, cfg.everos_dir) # Keep ANY child we spawned — including "readiness timeout (left # running)" — so shutdown can stop it; an untracked slow starter # would outlive Hermes holding the OME lock. On a re-init that diff --git a/hermes/plugin.yaml b/hermes/plugin.yaml index 9b9bae9..b13507b 100644 --- a/hermes/plugin.yaml +++ b/hermes/plugin.yaml @@ -1,5 +1,5 @@ name: everos -version: "1.0.0" +version: "1.0.1" manifest_version: 1 description: "EverOS-backed cross-session memory — markdown source of truth, hybrid recall, user + agent tracks." hooks: diff --git a/hermes/tests/test_core.py b/hermes/tests/test_core.py index 4964306..b80e891 100644 --- a/hermes/tests/test_core.py +++ b/hermes/tests/test_core.py @@ -227,5 +227,23 @@ def test_profile_basename_sanitized(self): self.assertEqual(mod.path_safe_project_id(None), "default") +class TestHostLoaderContract(unittest.TestCase): + def test_no_package_global_is_named_after_a_sibling_module(self): + # Hermes >= 2026.9.7 setattr()s every sibling module onto the package after + # __init__ runs; a global sharing a module's name is silently replaced by it + # (this broke EverOS auto-start: `provision` became the provision module). + import types + from pathlib import Path + + for path in Path(mod.__file__).parent.glob("*.py"): + if path.stem == "__init__": + continue + value = getattr(mod, path.stem, None) + self.assertTrue( + value is None or isinstance(value, types.ModuleType), + f"package global {path.stem!r} would be replaced by {path.name}", + ) + + if __name__ == "__main__": unittest.main() diff --git a/hermes/tests/test_provider.py b/hermes/tests/test_provider.py index eaa704a..4cc83a0 100644 --- a/hermes/tests/test_provider.py +++ b/hermes/tests/test_provider.py @@ -55,16 +55,16 @@ def of(self, kind): def make_provider(tmp_home: str, agent_context: str = "primary"): """Provider with inline daemons, provisioning stubbed, and a fake client.""" provider = mod.EverosMemoryProvider() - real_spawn, real_provision = mod._spawn_daemon, mod.provision + real_spawn, real_provision = mod._spawn_daemon, mod.provision_everos mod._spawn_daemon = lambda fn: fn() - mod.provision = lambda *a, **k: provision_mod.ProvisionResult("failed", "stubbed") + mod.provision_everos = lambda *a, **k: provision_mod.ProvisionResult("failed", "stubbed") try: provider.initialize( "session-1", hermes_home=tmp_home, platform="cli", agent_context=agent_context ) finally: mod._spawn_daemon = real_spawn - mod.provision = real_provision + mod.provision_everos = real_provision fake = FakeClient() provider._client = fake # inline daemons for the provider's later background posts @@ -90,17 +90,17 @@ def test_is_available_makes_no_network_calls(self): def test_initialize_stores_and_clips_session_id(self): provider, _ = make_provider(self.tmp.name) self.assertEqual(provider._sid, "session-1") - real_provision = mod.provision # keep the re-init from real provisioning - mod.provision = lambda *a, **k: provision_mod.ProvisionResult("failed", "stub") + real_provision = mod.provision_everos # keep the re-init from real provisioning + mod.provision_everos = lambda *a, **k: provision_mod.ProvisionResult("failed", "stub") try: provider.initialize("x" * 200, hermes_home=self.tmp.name) finally: - mod.provision = real_provision + mod.provision_everos = real_provision self.assertEqual(len(provider._sid), 128) def test_left_running_child_kept_for_shutdown(self): provider = mod.EverosMemoryProvider() - real_spawn, real_provision = mod._spawn_daemon, mod.provision + real_spawn, real_provision = mod._spawn_daemon, mod.provision_everos class DeadChild: def poll(self): @@ -108,14 +108,14 @@ def poll(self): child = DeadChild() mod._spawn_daemon = lambda fn: fn() - mod.provision = lambda *a, **k: provision_mod.ProvisionResult( + mod.provision_everos = lambda *a, **k: provision_mod.ProvisionResult( "failed", "readiness timeout (left running)", child=child ) try: provider.initialize("s", hermes_home=self.tmp.name) finally: mod._spawn_daemon = real_spawn - mod.provision = real_provision + mod.provision_everos = real_provision self.assertIs(provider._child, child) def test_shutdown_flushes(self): From 854ffce98be5552123cf239053c2a88fd6da6f7a Mon Sep 17 00:00:00 2001 From: zhanghui Date: Fri, 13 Nov 2026 13:44:24 +0800 Subject: [PATCH 2/2] docs(codex): tell users to trust the hooks after installing Codex installs plugin hooks untrusted and runs none of them until the user trusts them in /hooks, so following the README produced a plugin that installed fine and remembered nothing. Codex 0.167 also pins that trust to the plugin's content hash, so every plugin update needs trusting again. The README's "hooks fire on a real session" came from probe-hooks.sh, which runs with --dangerously-bypass-hook-trust; say so, and record that install and hook discovery were checked on both 0.149.0 and 0.167.2. Co-Authored-By: Claude Opus 5.5 --- codex/README.md | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/codex/README.md b/codex/README.md index 36e4f78..cf58a13 100644 --- a/codex/README.md +++ b/codex/README.md @@ -35,14 +35,22 @@ codex plugin marketplace add EverMind-AI/Plugins codex plugin add everos@everos ``` -Then point it at your EverOS if it is not on the default address: +Then open `/hooks` in a Codex session and trust the five EverOS hooks. Codex +installs plugin hooks untrusted and does not run them until you do, so a skipped +step looks like a plugin that installed fine and remembers nothing. Codex 0.167 +pins the trust to the plugin's content: after every plugin update the hooks show +as modified and need trusting again. + +Point it at your EverOS if it is not on the default address: ```bash export EVEROS_CODEX_BASE_URL=http://127.0.0.1:8000 ``` -Verified end to end against Codex 0.149.0: the marketplace resolves, the plugin -installs as `installed, enabled`, and its hooks fire on a real session. +Verified against Codex 0.149.0 and 0.167.2: the marketplace resolves, the plugin +installs as `installed, enabled`, and Codex discovers all five hooks with no errors. +That the hooks fire on a real session was probed with +`--dangerously-bypass-hook-trust` (`scripts/probe-hooks.sh`), not through `/hooks`. ## Two memory systems