Skip to content

feat(mac-launcher): auto-discover an mlx_lm-capable Python (no manual KAKEYA_MAC_PYTHON)#156

Merged
cursor[bot] merged 1 commit into
mainfrom
AgentMemory/mac-launcher-autodiscover-python-2815
Jun 19, 2026
Merged

feat(mac-launcher): auto-discover an mlx_lm-capable Python (no manual KAKEYA_MAC_PYTHON)#156
cursor[bot] merged 1 commit into
mainfrom
AgentMemory/mac-launcher-autodiscover-python-2815

Conversation

@FluffyAIcode

Copy link
Copy Markdown
Owner

Why

After the merge, bash scripts/run_kakeya_mac.sh failed with mlx/mlx_lm not importable by python3 — set KAKEYA_MAC_PYTHON. That's the #150 preflight working as designed (fail fast instead of a deep ModuleNotFoundError), but it's friction: a bare python3 in a fresh shell / after a reboot is often the system/pyenv one without mlx_lm, even though a venv with it exists.

Fix

The launcher now auto-discovers the interpreter: it tries KAKEYA_MAC_PYTHON<repo>/.venv-mac~/kakeya-venv~/.venvpython3.13python3, and picks the first that can import mlx_lm (logs which one). It only fails fast — now listing the searched candidates — when none has mlx_lm. bash-3.2 safe.

Validation (Mac M4)

mlx-kakeya-launcher-dryrun-bash32 (runs /bin/bash run_kakeya_mac.sh --dry-run) on the runner: auto-discovery resolved to …/.venv-mac/bin/python3.13 (the venv that has mlx_lm) and the dry-run printed the command with it. Locally: a fake mlx_lm python is picked; with none available the preflight fails cleanly with the actionable message (no crash).

Testing

  • ✅ On-device dry-run: discovery picks the mlx_lm venv python
  • bash -n scripts/run_kakeya_mac.sh; local discovery + clean-failure tests
  • pytest tests/inference_engine/bridge/test_manifest.py

Note: if your venv lives in a non-standard path the candidates don't cover (e.g. a different checkout dir), set KAKEYA_MAC_PYTHON=/path/to/venv/bin/python once — discovery prefers it.

Open in Web Open in Cursor 

… KAKEYA_MAC_PYTHON needed)

After a reboot / in a fresh shell the bare 'python3' is often the system/pyenv
one without mlx_lm, so the launcher's preflight failed ('mlx/mlx_lm not
importable by python3'). Now the launcher tries KAKEYA_MAC_PYTHON -> repo
.venv-mac -> ~/kakeya-venv -> ~/.venv -> python3.13 -> python3 and picks the
FIRST that can 'import mlx_lm' (logs which). Only fails fast (with the searched
candidates listed) when none exists. bash 3.2-safe.

Co-authored-by: FluffyAIcode <FluffyAIcode@users.noreply.github.com>
@cursor cursor Bot merged commit 0b206d4 into main Jun 19, 2026
8 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.

2 participants