From 08f5a0a98ba5094ef8ffe8d460037a83565620fe Mon Sep 17 00:00:00 2001 From: suntech-wang Date: Tue, 11 Aug 2026 21:35:18 +0800 Subject: [PATCH] fix(update): isolate pip install from third-party UV env vars uv respects UV_PYTHON_INSTALL_DIR from the process environment. When a third-party app (e.g. WorkBuddy) sets a User-level UV_PYTHON_INSTALL_DIR, the update's uv pip install can target the wrong interpreter and fail installing extras, leaving the venv entry-point shims missing. Use the official managed_python_env() isolation (drops VIRTUAL_ENV/PYTHONPATH/ UV_PYTHON, forces UV_PYTHON_INSTALL_DIR to .hermes-runtime/python, UV_NO_CONFIG=1) and then point VIRTUAL_ENV at this install's venv. --- hermes_cli/update_cmd.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hermes_cli/update_cmd.py b/hermes_cli/update_cmd.py index 8997f03508..3bb13283b6 100644 --- a/hermes_cli/update_cmd.py +++ b/hermes_cli/update_cmd.py @@ -6638,7 +6638,11 @@ def _cmd_update_impl(args, gateway_mode: bool): install_group = "all" if uv_bin: - uv_env = {**os.environ, "VIRTUAL_ENV": str(_m().PROJECT_ROOT / "venv")} + # 2026-08-11 patch: use official managed_python_env() isolation so + # third-party UV_PYTHON_INSTALL_DIR (WorkBuddy) cannot hijack uv; + # then point VIRTUAL_ENV at this install's venv. + uv_env = managed_python_env() + uv_env["VIRTUAL_ENV"] = str(_m().PROJECT_ROOT / "venv") if _m()._is_termux_env(uv_env): uv_env.pop("PYTHONPATH", None) uv_env.pop("PYTHONHOME", None)