altimate-code icon indicating copy to clipboard operation
altimate-code copied to clipboard

altimate-engine not found when user's project has .venv in cwd

Open anandgupta42 opened this issue 8 months ago • 0 comments

Problem

When a user runs altimate-code from a directory that contains its own .venv (any Python project), the bridge fails to find altimate-engine because resolvePython() picks the CWD's .venv/bin/python before checking the managed engine venv where ensureEngine() actually installs the package.

Root Cause

In packages/opencode/src/altimate/bridge/client.ts, resolvePython() checks for Python interpreters in this order:

  1. OPENCODE_PYTHON env var
  2. Local dev .venv (next to altimate-engine package)
  3. .venv in CWD ← picks this up from user's project
  4. Managed engine venv ← where altimate-engine is actually installed
  5. python3 fallback

Step 3 shadows step 4, so the bridge spawns a Python that doesn't have altimate-engine.

Expected Behavior

The managed engine venv (where ensureEngine() installs altimate-engine) should be checked before the CWD .venv.

anandgupta42 avatar Mar 16 '26 22:03 anandgupta42