From 6127170cffb6b38618ef750479651c7787babbc6 Mon Sep 17 00:00:00 2001 From: James Phenry Date: Mon, 29 Jun 2026 14:20:18 -0500 Subject: [PATCH] fix(portable): reinstall anthropic provider on venv rebuild The venv lives on the local filesystem (exFAT/NTFS don't support the hardlinks uv venv needs) and is therefore wiped on every reboot. The rebuild block in launch.sh re-installs the core hermes-agent package and python-telegram-bot, but not the anthropic provider that setup-unix.sh installs on first run (step 9). After a reboot, chat fails with an import error when the agent tries to talk to Anthropic. Add anthropic>=0.39.0 to both the uv and pip fallback install lines so the rebuild path mirrors setup-unix.sh exactly. A comment above the block warns future contributors that the two paths must stay in sync, since [all] is deliberately not exhaustive and the install list is the actual contract. --- launch.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/launch.sh b/launch.sh index b06d942..40842ab 100644 --- a/launch.sh +++ b/launch.sh @@ -115,12 +115,19 @@ if [ ! -x "$VIRTUAL_ENV/bin/python" ]; then if ! "$UV_EXE" venv "$VIRTUAL_ENV" --python "$PYTHON_EXE" --seed 2>/dev/null; then "$UV_EXE" venv "$VIRTUAL_ENV" --python "$PYTHON_EXE" fi + # NOTE: This install list must stay in sync with scripts/setup-unix.sh + # (steps 8, 9, 10). setup-unix.sh installs core + anthropic + telegram + # because [all] is deliberately not exhaustive. The rebuild path here + # replicates the same three packages; drift between the two paths is + # the root cause of "library not installed" errors after reboot. if ! "$UV_EXE" pip install --python "$VIRTUAL_ENV/bin/python" --link-mode=copy \ -e "$SRC_DIR/hermes-agent[all]" \ + "anthropic>=0.39.0" \ "python-telegram-bot[webhooks]==22.6" 2>/dev/null; then "$VIRTUAL_ENV/bin/python" -m ensurepip --upgrade >/dev/null 2>&1 || true "$VIRTUAL_ENV/bin/python" -m pip install \ -e "$SRC_DIR/hermes-agent[all]" \ + "anthropic>=0.39.0" \ "python-telegram-bot[webhooks]==22.6" 2>/dev/null || true fi echo "[OK] Venv rebuilt."