Skip to content

fix(kb): re-exec python shims under .venv when ladybug is missing - #41

Merged
eSlider merged 1 commit into
mainfrom
fix/index-venv-reexec
Aug 17, 2026
Merged

fix(kb): re-exec python shims under .venv when ladybug is missing#41
eSlider merged 1 commit into
mainfrom
fix/index-venv-reexec

Conversation

@eSlider

@eSlider eSlider commented Aug 17, 2026

Copy link
Copy Markdown
Owner

Problem — Step 3 of the mail→brain workflow, bin/brain/index.go --rebuild, failed on this host with ModuleNotFoundError: No module named 'ladybug'. The python shims (bin/kb/index, bin/kb/add, ...) shebang to #!/usr/bin/env python3, which resolves to system python3 without the project deps (ladybug/model2vec live in .venv/).

Fix — bin/tools/kblib.py now re-execs the running script under <repo>/.venv/bin/python3 when the active interpreter cannot import ladybug. The Docker index image keeps python3 with ladybug on PATH, so the block is skipped there. Verified:

  • bin/brain/index.go --dry-run --with-facts --with-chats works without activating the venv
  • full --rebuild: 16702 info + 9 facts in 4m11s
  • bin/tools/test_kblib.py: 11 tests OK under both system python3 and venv

bin/brain/index.go --rebuild (-> bin/kb/index) failed on hosts where
system python3 lacks ladybug/model2vec. kblib now re-execs itself via
the repo .venv python when the active interpreter cannot import ladybug,
so the documented workflow works without activating the venv first.
Docker index image (PATH python3 has ladybug) is unaffected.
@cursor

cursor Bot commented Aug 17, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@eSlider
eSlider merged commit b1e6953 into main Aug 17, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant