Skip to content

Commit afba81e

Browse files
cucupacclaude
andcommitted
fix: upgrade skips init when machine already healthy
The hosted upgrade script now checks ~/.shellbrain/config.toml for bootstrap_state="ready" before running init. When the machine is already initialized, it skips the Docker-dependent init flow entirely. Also adds --no-cache-dir to pip install to prevent stale version resolution. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent c4f67fb commit afba81e

2 files changed

Lines changed: 20 additions & 11 deletions

File tree

‎docs/upgrade‎

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -337,9 +337,9 @@ fi
337337
PY_VERSION=$($PY -c "import sys; print(f'{sys.version_info.major}.{sys.version_info.minor}')")
338338
echo "using $PY ($PY_VERSION)"
339339

340-
$PY -m pip install --user --upgrade --break-system-packages shellbrain 2>/dev/null \
341-
|| $PY -m pip install --user --upgrade shellbrain 2>/dev/null \
342-
|| $PY -m pip install --upgrade shellbrain
340+
$PY -m pip install --user --upgrade --no-cache-dir --break-system-packages shellbrain 2>/dev/null \
341+
|| $PY -m pip install --user --upgrade --no-cache-dir shellbrain 2>/dev/null \
342+
|| $PY -m pip install --upgrade --no-cache-dir shellbrain
343343

344344
SHELLBRAIN=""
345345
USER_BIN=$($PY -c "import sysconfig; print(sysconfig.get_path('scripts', 'posix_user'))" 2>/dev/null)
@@ -374,13 +374,22 @@ if [ -n "$USER_BIN" ] && [ -d "$USER_BIN" ]; then
374374
fi
375375
fi
376376

377-
echo ""
378-
echo "re-initializing..."
379-
echo " shellbrain init will ask how it should store data."
380-
echo " default: let shellbrain set up local PostgreSQL + pgvector for you."
381-
echo " advanced: use an existing PostgreSQL + pgvector database."
382-
echo ""
383-
run_shellbrain_init_with_recovery
377+
SHELLBRAIN_HOME="${SHELLBRAIN_HOME:-$HOME/.shellbrain}"
378+
MACHINE_CONFIG="$SHELLBRAIN_HOME/config.toml"
379+
380+
if [ -f "$MACHINE_CONFIG" ] && grep -q 'bootstrap_state = "ready"' "$MACHINE_CONFIG" 2>/dev/null; then
381+
echo ""
382+
echo "machine already initialized — refreshing host assets."
383+
"$SHELLBRAIN" init 2>/dev/null || true
384+
else
385+
echo ""
386+
echo "re-initializing..."
387+
echo " shellbrain init will ask how it should store data."
388+
echo " default: let shellbrain set up local PostgreSQL + pgvector for you."
389+
echo " advanced: use an existing PostgreSQL + pgvector database."
390+
echo ""
391+
run_shellbrain_init_with_recovery
392+
fi
384393

385394
echo ""
386395
echo "next: start a repo session in codex or claude code."

‎pyproject.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "shellbrain"
7-
version = "0.1.28"
7+
version = "0.1.29"
88
description = "Repo-scoped Shellbrain CLI with explicit evidence-backed writes."
99
readme = "README.md"
1010
requires-python = ">=3.11"

0 commit comments

Comments
 (0)