Skip to content

fix(hindsight): actionable error when local_embedded runtime is missing (#7718) - #70295

Closed
benfrank241 wants to merge 1 commit into
NousResearch:mainfrom
benfrank241:fix/hindsight-local-embedded-missing-dep-message
Closed

fix(hindsight): actionable error when local_embedded runtime is missing (#7718)#70295
benfrank241 wants to merge 1 commit into
NousResearch:mainfrom
benfrank241:fix/hindsight-local-embedded-missing-dep-message

Conversation

@benfrank241

Copy link
Copy Markdown
Contributor

Addresses #7718.

Background (verified against PyPI)

local_embedded runs from hindsight import HindsightEmbedded. I confirmed against the published wheels (0.8.5):

  • hindsight-all ships the top-level hindsight/ package — hindsight/__init__.py does from .embedded import HindsightEmbedded and exports it in __all__. This is the only package that satisfies the import.
  • hindsight-embed ships only hindsight_embed/no top-level hindsight, no HindsightEmbedded class (its deps are just httpx + rich).
  • hindsight-client (what plugin.yaml declares) provides hindsight_client.* — enough for cloud / local_external only.

So a user who selects local_embedded without running hermes memory setup (hand-written config, the legacy "mode": "local" alias, or a restored backup — the wizard is the only path that installs hindsight-all) hits ModuleNotFoundError: No module named 'hindsight'.

What main already does vs. what's missing

initialize() already calls _check_local_runtime() and, when the import fails, logs one warning and disables the provider — so the silent per-sync memory loss and fake-healthy INFO log from the original v0.8.0 report are already gone. What's missing is that the warning just echoes No module named 'hindsight' with no fix.

Change

Add _local_runtime_hint() and append it to the disable warning. When the failure is a missing hindsight / hindsight_embed module, the user now sees:

Hindsight local mode disabled because its runtime could not be imported: No module named 'hindsight'. Install the embedded runtime with: uv pip install --python <exe> hindsight-all — or run hermes memory setup. (local_embedded needs the 'hindsight-all' package, which provides the top-level 'hindsight' module; 'hindsight-client' alone only covers cloud / local_external.)

Unrelated runtime failures (e.g. the NumPy-on-old-CPU case _check_local_runtime also guards) get no hint, so the message stays accurate.

Why not declare hindsight-all in plugin.yaml? It pulls the full server stack (hindsight-api-slim[all], torch/sentence-transformers). Declaring it unconditionally would bloat every cloud-only install with hundreds of MB they don't need. A runtime hint fixes the diagnosis for local users without penalizing the majority. (A mode-conditional pip_dependencies mechanism would be the clean long-term fix, but that's a plugin-loader change out of scope here.)

Tests

tests/plugins/memory/test_hindsight_local_runtime_hint.py:

  • missing hindsight / hindsight_embed → hint names hindsight-all + hermes memory setup + the interpreter path
  • unrelated errors (and None) → no hint
scripts/run_tests.sh tests/plugins/memory/test_hindsight_local_runtime_hint.py   # 3 passed

(The 2 pre-existing test_hindsight_provider.py::TestAvailability/TestConfig failures reproduce on a clean main and are unrelated.)

Note on #57243

#57243 targets the same issue but adds hindsight-embed to plugin.yaml to satisfy the import. Per the wheel contents above, hindsight-embed provides neither the top-level hindsight module nor HindsightEmbedded, so that approach would still ModuleNotFoundError. Flagging so the two aren't merged in conflict.

…ng (NousResearch#7718)

local_embedded imports `from hindsight import HindsightEmbedded`, which is
provided only by the `hindsight-all` package. plugin.yaml declares only
`hindsight-client` (enough for cloud / local_external), so a user who selects
local_embedded without running `hermes memory setup` — a hand-written config,
the legacy `"mode": "local"` alias, or a restored backup — hits
`ModuleNotFoundError: No module named 'hindsight'`.

`initialize()` already disables the provider with one warning in this case
(so the silent per-sync failure from the original report is gone), but the
message just echoes `No module named 'hindsight'` with no fix. Add an
actionable hint telling the user to install `hindsight-all` (or run
`hermes memory setup`), plus the distinction from `hindsight-client`.

Kept as a runtime hint rather than declaring `hindsight-all` in plugin.yaml:
that package pulls the full server stack (hindsight-api-slim[all], torch), so
declaring it unconditionally would bloat every cloud-only install.
@benfrank241

Copy link
Copy Markdown
Contributor Author

Superseded by the combined PR #74379 — same changes bundled into a single review surface. Closing this one to consolidate.

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

Labels

area/memory Memory subsystem: store, providers, sync, background reviews comp/plugins Plugin system and bundled plugins P3 Low — cosmetic, nice to have tool/memory Memory tool and memory providers type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants