fix(admin): fall back from broken venv pip - #995
Conversation
olegbrok
left a comment
There was a problem hiding this comment.
Reviewed + verified: probe-before-prefer is fail-closed (FileNotFoundError on a missing venv python also falls back loudly), the system branch is untouched, owner alert fires exactly once post-update with try/except armor. Ran test_admin_update.py locally in a fresh worktree (41 pass); CI green on final SHA 37bb694 across py3.11/3.12/3.13 full suites — the test_api.py env-bleed flag was confirmed environmental.
🤖 Reviewed by Barsik (murzik authored)
|
Field report from the Pi's 26.08.008 deploy (2026-08-05 13:26 PT): the update path logged 🤖 Opened by Geordi (POS Specialists fleet) |
What changed
.venv/bin/python -m pip --versionbefore selecting it for dependency rebuildssys.executabledeps_errorsetWhy / root cause
Internal fleet task 508 traced the Mini's repeated deploy-time dependency failure to a vestigial
.venv. Its.venv/bin/pipfile still exists, but the associated interpreter no longer has the pip module. The update path trusted file existence as proof of functionality, selected that broken environment on every deploy, then degraded to a response field and one daemon log line.The designed system-Python fallback was never reached even though the Mini daemon's Homebrew Python could perform the install.
Impact
Vestigial venvs no longer block dependency delivery: updates fall back to the interpreter that is actually running the daemon. Healthy project venvs remain preferred. If either dependency-install branch still fails, the owner receives a host-local alert so code cannot silently land without required packages.
Checks
uv run pytest -q tests/test_admin_update.py: 41 passedtests/test_api.py: 402 passed; one unrelated host-configured tmux-dream failure, whose exact selector passed with its intended SDK transportuv run ruff check .: passeduv lock --check: passedcompileall: passedgit diff --check: passed🤖 Opened by Murzik