From ab2c9289cad5c446401c407f29dac6760620b577 Mon Sep 17 00:00:00 2001 From: spiky02plateau <155588579+spiky02plateau@users.noreply.github.com> Date: Mon, 20 Jul 2026 13:10:59 +0200 Subject: [PATCH] fix(hindsight): availability probe must cover the embedding stack for local modes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit _check_local_runtime() only imported 'hindsight' and 'hindsight_embed.daemon_embed_manager', a strictly weaker import surface than the embedded daemon actually needs: the daemon imports sentence_transformers at startup (embeddings + reranker). When the embedding stack is broken (e.g. a dependency conflict on a shared package like huggingface-hub), the daemon can never start, yet is_available() and 'hermes memory status' still report Hindsight as available — every retain/recall then fails silently. Import sentence_transformers in the same probe so local/local_embedded availability goes red with the real ImportError as the reason, letting the agent degrade loudly instead of silently dropping memory. Local path only; cloud mode is untouched and no network or model download is triggered by the import. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01MN8RMDLwxCfFxwtADoEJJf --- plugins/memory/hindsight/__init__.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins/memory/hindsight/__init__.py b/plugins/memory/hindsight/__init__.py index 00b6d7a8f8eaa..b5b2aa8cd955c 100644 --- a/plugins/memory/hindsight/__init__.py +++ b/plugins/memory/hindsight/__init__.py @@ -131,10 +131,19 @@ def _check_local_runtime() -> tuple[bool, str | None]: error from NumPy before the daemon starts. Treat that as "unavailable" so Hermes can degrade gracefully instead of repeatedly trying to start a broken local memory backend. + + The embedded daemon computes embeddings via ``sentence_transformers`` + (transformers + huggingface-hub). Importing ``hindsight`` / + ``hindsight_embed`` alone succeeds even when that stack is broken, so + without importing it here the probe would falsely report the backend + healthy and ``hermes memory status`` would stay green while the daemon + aborts at startup on every retain/recall. Import it too so the probe (and + status) reports the real ImportError. """ try: importlib.import_module("hindsight") importlib.import_module("hindsight_embed.daemon_embed_manager") + importlib.import_module("sentence_transformers") return True, None except Exception as exc: return False, str(exc)