fix(update): heal active memory provider deps after venv rebuild - #72363
Merged
Conversation
… local modes _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 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MN8RMDLwxCfFxwtADoEJJf
Surgical reapply of #53505 by @LeonSGP43 onto current main (stale-base cherry-pick conflicted in main.py): - _refresh_active_memory_provider_dependencies() in hermes_cli/main.py, wired into BOTH the git-pull update path (after lazy refresh) and the ZIP update path — the provider's plugin.yaml bridge packages are not in extras or LAZY_DEPS, so the core reinstall could strip/downgrade them and the update flow never healed them (#53272 mem0ai). - _install_dependencies(force=True) in memory_setup.py: hand every declared spec to the resolver on update so missing AND version-drifted packages are restored (no-op when satisfied). - Skip guards: no provider / builtin store / memory.enabled=false. Widened beyond the original PR for the #70636 half: - _provider_pip_dependencies(): mode-aware expansion — Hindsight in local/local_embedded mode needs hindsight-all (daemon + embedder), not just the declared hindsight-client; setup installs it but plugin.yaml can't express it, so update-time healing previously missed hindsight-embed and the daemon stayed broken. - Spec-aware import probing: version ranges in pip_dependencies (mem0ai>=2.0.10,<3) no longer break the pip-name -> import-name mapping. Fixes #53272. Fixes the hindsight-embed half of #70636.
Contributor
૮ >ﻌ< ა ci reviewran on b295ce3 all good! |
This was referenced Jul 27, 2026
Enough1122
added a commit
to Enough1122/hermes-agent
that referenced
this pull request
Aug 8, 2026
…hindsight-all _provider_pip_dependencies appends a bare `hindsight-all` spec for every local/local_embedded install (added by NousResearch#72363 to heal Hindsight after a venv rebuild). On Intel macOS the full local-ML dependency set pulls MLX packages that ship no x86_64 wheels; the resolver backtracks instead of failing, installing ancient hindsight-all / hindsight-api releases whose overlapping hindsight_api files override the working slim API. The daemon then crashes with 'Unknown embeddings provider: onnx' and the web UI reports HTTP 500/502 (NousResearch#81421). Fix: detect Darwin + x86_64 in _provider_pip_dependencies and install the thin slim stack (hindsight-all-slim + hindsight-api-slim[local-onnx]) for local/local_embedded mode there. Apple Silicon, Linux, and all other platforms keep the full bundle — the NousResearch#70636 heal path is unchanged. Non-local modes and missing config are unaffected. Adds 6 regression tests: Intel-macOS detection, arm64/linux negatives, the issue's exact scenario (bare hindsight-all must not appear on Intel macOS), non-Intel keeps the full bundle, non-local modes unchanged, and missing-config fallback. The issue scenario is RED on pre-fix code (old code appends bare hindsight-all unconditionally).
Enough1122
added a commit
to Enough1122/hermes-agent
that referenced
this pull request
Aug 14, 2026
…hindsight-all _provider_pip_dependencies appends a bare `hindsight-all` spec for every local/local_embedded install (added by NousResearch#72363 to heal Hindsight after a venv rebuild). On Intel macOS the full local-ML dependency set pulls MLX packages that ship no x86_64 wheels; the resolver backtracks instead of failing, installing ancient hindsight-all / hindsight-api releases whose overlapping hindsight_api files override the working slim API. The daemon then crashes with 'Unknown embeddings provider: onnx' and the web UI reports HTTP 500/502 (NousResearch#81421). Fix: detect Darwin + x86_64 in _provider_pip_dependencies and install the thin slim stack (hindsight-all-slim + hindsight-api-slim[local-onnx]) for local/local_embedded mode there. Apple Silicon, Linux, and all other platforms keep the full bundle — the NousResearch#70636 heal path is unchanged. Non-local modes and missing config are unaffected. Adds 6 regression tests: Intel-macOS detection, arm64/linux negatives, the issue's exact scenario (bare hindsight-all must not appear on Intel macOS), non-Intel keeps the full bundle, non-local modes unchanged, and missing-config fallback. The issue scenario is RED on pre-fix code (old code appends bare hindsight-all unconditionally).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
hermes updatenow heals the active memory provider's pip dependencies after the core reinstall — Mem0 OSS and local Hindsight (including the embedded daemon stack) survive every update instead of silently breaking until a manual reinstall (fixes #53272, fixes the hindsight-embed half of #70636).Root cause: memory-provider bridge packages are declared in each provider's
plugin.yaml(installed byhermes memory setup), NOT in Hermes' extras or LAZY_DEPS — so the update flow's.[all]reinstall + lazy refresh could strip or downgrade them and nothing ever put them back. Hindsightlocal_embeddedis worse: setup installshindsight-all(daemon + embedder + client), which even the manifest doesn't declare, sohindsight-embedwas invisible to every refresh path.Changes
hermes_cli/main.py:_refresh_active_memory_provider_dependencies()— re-runs the ACTIVE provider's declared dep install after the core install + lazy refresh, wired into both the git-pull and ZIP update paths. Skips builtin/none/disabled. Never raises.hermes_cli/memory_setup.py:_install_dependencies(force=True)hands every declared spec to the resolver (restores missing AND version-drifted packages; no-op when satisfied). Spec-aware import probing so version ranges (mem0ai>=2.0.10,<3) map to import names correctly.hermes_cli/memory_setup.py:_provider_pip_dependencies()— mode-aware expansion: Hindsight inlocal/local_embeddedmode addshindsight-all, matching what setup actually installs (hermes update downgrades/removes third-party packages installed into the managed venv (e.g. hindsight-embed) #70636's missing piece).plugins/memory/hindsight/__init__.py: availability probe now importssentence_transformerstoo (salvaged from fix(memory/hindsight): availability probe must check the embedding stack, not just the API modules #68009 by @spiky02plateau) —hermes memory status/is_available()report the real ImportError instead of staying green while the daemon aborts at startup.Validation
hermes updatewith mem0 OSS activemem0aigone → "No module named 'mem0'"hindsight-embedstripped, daemon dead, status greenhindsight-client+hindsight-allhealed; probe reports embedding-stack breakage honestlyscripts/run_tests.sh tests/hermes_cli/test_update_autostash.py tests/hermes_cli/test_memory_setup.py tests/plugins/memory/test_hindsight_provider.py— 184/184 greentest_cmd_update_refreshes_active_memory_provider_dependencies['hindsight-client>=0.6.1', 'hindsight-all']Credit
Salvages #53505 by @LeonSGP43 (update-path refresh — surgical reapply, stale base) and #68009 by @spiky02plateau (embedding-stack probe), authorship preserved. #40341 (@GodsBoy discussion) and #53298 identified the same mechanism earlier for the plugin.yaml route.
Fixes #53272. Fixes the package-healing half of #70636 (the hermes.env overwrite half is #70606, separate).
Infographic