Conversation
… stays current Fixes the case where an install has both venv/ and .venv/ (git-install + bootstrap flow): hermes update only synced deps into venv/, leaving the .venv used by the CLI shim and desktop-served profiles stale (ModuleNotFoundError: snowballstemmer). Probe, sync, and holder-detect across all present project venvs. Closes NousResearch#97340
Overall: Ensures ZIP-fallback update syncs deps into every present project venv (both What it does
Non-blocking notes
Non-blocking — please use your judgment. |
|
Thanks for the review. The overall read is right — this is the #97340 fix, and the shared On the two non-blocking notes: 1. Best-effort continue vs. bubbling. I kept the bubble deliberately. If 2. "Helper handles case where neither venv exists gracefully (returns empty...)." This one's wrong — the helper never returns empty. It's |
Summary
On an install that carries both
venv/and.venv/(older git-install flow + uv/bootstrap-installer flow),hermes updateonly synced Python dependencies intovenv/. The~/.local/bin/hermeslauncher shim and Desktop-app-spawnedhermes --profile <p> serve --isolatedprocesses run from.venv, so any dependency a release adds is missing there after the update — observed asModuleNotFoundError: snowballstemmerafter v0.20.4 → v0.20.6.The updater hardcoded
PROJECT_ROOT / "venv"at every dependency-sync, import-health-probe, and holder-process-detection site inhermes_cli/update_cmd.py.Changes
Introduces
_project_venv_dirs()which enumerates all present project venvs (venvthen.venv; falls back to a singlevenvtarget when neither exists, preserving dev-checkout behavior) and routes every previously hardcoded site through it:_cmd_update_impl), the ZIP fallback path (_update_via_zip), and the repair path all install into every present venv._venv_core_imports_healthy) — reports unhealthy if any present venv is missing a core import, so a stale.venvtriggers a repair instead of silently passing._detect_venv_python_processes,_venv_launcher_ancestors) — Windows lock-holder guards now scan for processes running from any present project venv, not justvenv.The primary (
venv) env is kept as the lazy-refresh / tool-dependency / verify target, matching pre-change behavior on both the deps-current and deps-changed paths.No new env vars, no telemetry, no lockfile churn. Single-venv installs and venv-less dev checkouts behave exactly as before.
Tests
New
tests/hermes_cli/test_update_multi_venv_sync.py(4 tests) proves the fix:venv/and.venv/present,_project_venv_dirs()yields both (venv then .venv)..venvmissing a core import now trips an unhealthy probe (pre-fix code only probedvenv/and returned healthy). Verified: the test suite fails 4/4 against the pre-fix code (AttributeError: no _project_venv_dirs+ probe not covering .venv) and passes 4/4 on the fix.Existing
test_update_stale_virtualenv.py(9) plustest_update_self_lock.py,test_update_concurrent_quarantine.py,test_update_interrupted_recovery.py,test_verify_core_dependencies.py(54) all pass — no regressions.Closes #97340