Skip to content

bug(hermes): auto-provision is silently dead — provision is shadowed by its own submodule #31

Open

Description

@yshengding6

In a real Hermes session the provider's auto-provision step never runs: _provision() raises TypeError: 'module' object is not callable, the exception is swallowed inside the daemon thread, and everos server start is never attempted. Recall/capture work fine once the server is up some other way, which makes this easy to miss — the failure is completely silent.

Environment

  • Hermes Agent v0.22.1 (2026.9.24), git install — macOS 27.0.1 (arm64)
  • Plugin: hermes plugins install EverMind-AI/plugins/hermes → ~/.hermes/plugins/everos (v1.0.0)
  • EverOS 1.4.2, installed with uv tool install --python 3.12 everos
  • ~/.hermes/everos.json: start_cmd = "/Users/ding/.local/bin/everos server start", everos_dir = "/Users/ding/.everos"

Steps to reproduce

  1. Install + configure the plugin.
  2. Make sure nothing is listening on 8000 (lsof -nP -iTCP:8000 -sTCP:LISTEN).
  3. Start any Hermes session (any turn).
  4. Read ~/.hermes/logs/tui_gateway_crash.log.

Actual

=== thread exception · thread=Thread-266 (_provision) ===
Traceback (most recent call last):
  File "/Users/ding/.hermes/plugins/everos/__init__.py", line 482, in _provision
    result = provision(client, cfg.start_cmd, cfg.everos_dir)
TypeError: 'module' object is not callable

The server is never started and the provider fail-opens, so the only symptom is "memory quietly does nothing".

Root cause

__init__.py line 25 binds the function:

from .provision import provision, stop_child

But the host loader imports the plugin's sibling .py files as submodules of the synthetic package (plugins/plugin_loader.py:210 — for sub_file in plugin_dir.glob("*.py")). That import rebinds the package attribute provision to the submodule, clobbering the same-named function binding. stop_child survives only because no submodule is named stop_child.

Reproduced against the real loader inside the Hermes venv:

from plugins.memory import load_memory_provider
p = load_memory_provider("everos")
pkg = sys.modules[type(p).__module__]
type(pkg.provision)      # <class 'module'>    <-- shadowed
callable(pkg.provision)  # False
type(pkg.stop_child)     # <class 'function'>  <-- fine (name != submodule)

Then p.initialize(...) with the server down dies on exactly the traceback above.

Fix

Alias to a name that cannot collide with the submodule:

from .provision import provision as _run_provision, stop_child
...
result = _run_provision(client, cfg.start_cmd, cfg.everos_dir)

Verified locally: with the patch, initialize() with nothing on port 8000 brings EverOS up healthy in ~2s, and pkg.provision is still a module while pkg._run_provision is the callable.

Related: cli.py fails the same loader pass

The same sibling-import pass logs:

DEBUG plugins.memory: Failed to exec_module _hermes_user_memory.everos__source_<hash>.cli:
  cannot import name 'load_config' from '_hermes_user_memory.everos__source_<hash>'
  (/Users/ding/.hermes/plugins/everos/__init__.py)

so ctx.register_cli_command("everos", ...) never lands and hermes everos status is not a command in v0.22.1. cli.py's from . import load_config is the failing import — importing it inside run_status() (or from a module whose name cannot be shadowed) would make it resilient.

Note on capture timing (not a bug, but surprising)

sync_turn only POSTs into EverOS's per-session buffer — episodes are extracted on a seal (on_session_end / on_pre_compress / shutdown). In a short-lived one-shot run (hermes -z "...") the process can exit before the seal completes, so the turn is silently never extracted. Verified: the host path MemoryManager.sync_all(...) → nothing in the store; add MemoryManager.on_session_end(...) → the episode lands within ~6s. Worth a line in the README, and perhaps a more eager seal.

Activity

  1. yshengding6 commented on Oct 16, 2026

    @yshengding6
    Author

    Duplicate check: same root cause as #28 (opened 2026-09-22, still open). The diagnosis there matches exactly — setattr(mod, sub_name, sub_mod) in load_plugin_module() clobbering the from .provision import provision binding. Keeping this issue open only for the one finding #28 does not cover:

    Capture needs a seal. sync_turn only POSTs into EverOS's per-session buffer; episodes are extracted on a seal (on_session_end / on_pre_compress / shutdown). Measured on the real host path:

    MemoryManager.sync_all(...)        -> nothing in the store (buffered)
    MemoryManager.on_session_end(...)  -> episode extracted within ~6s
    

    Consequence: a short-lived one-shot run (hermes -z "...") can exit before the seal and silently drop the turn.

  2. gloryfromca commented on Nov 13, 2026

    @gloryfromca
    Member

    The provision shadowing is fixed on main in #40 (Hermes plugin 1.0.1). The function is now bound as provision_everos. A test fails if any package global shares a sibling module's name.

    Checked with Hermes's real loader on v0.23.1: with EverOS down, the start command runs again. Re-run hermes plugins install EverMind-AI/plugins/hermes to pick it up.

    Leaving this open for the remaining finding, a one-shot run exiting before the seal. That one is not addressed or verified yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions