fix: auto-bootstrap Python engine before starting bridge#25
Merged
anandgupta42 merged 2 commits intomainfrom Mar 3, 2026
Merged
fix: auto-bootstrap Python engine before starting bridge#25anandgupta42 merged 2 commits intomainfrom
anandgupta42 merged 2 commits intomainfrom
Conversation
Bridge.start() now calls ensureEngine() to download uv, create an isolated venv, and install altimate-engine before spawning the Python subprocess. resolvePython() also checks the managed venv path so the correct interpreter is used after bootstrapping. Previously, resolvePython() would fall through to system python3 which doesn't have altimate_engine installed, causing ModuleNotFoundError on first run. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Export resolvePython() from client.ts for direct unit testing - Test that ALTIMATE_CLI_PYTHON env var takes highest priority - Test that managed engine venv is used when present on disk - Test fallback to python3 when no venvs exist - Test that ensureEngine() is called before bridge spawn - Mock only bridge/engine module to avoid leaking into other tests Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
anandgupta42
added a commit
that referenced
this pull request
Mar 17, 2026
* fix: auto-bootstrap Python engine before starting bridge Bridge.start() now calls ensureEngine() to download uv, create an isolated venv, and install altimate-engine before spawning the Python subprocess. resolvePython() also checks the managed venv path so the correct interpreter is used after bootstrapping. Previously, resolvePython() would fall through to system python3 which doesn't have altimate_engine installed, causing ModuleNotFoundError on first run. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * test: add bridge client tests for ensureEngine and resolvePython - Export resolvePython() from client.ts for direct unit testing - Test that ALTIMATE_CLI_PYTHON env var takes highest priority - Test that managed engine venv is used when present on disk - Test fallback to python3 when no venvs exist - Test that ensureEngine() is called before bridge spawn - Mock only bridge/engine module to avoid leaking into other tests Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
anandgupta42
added a commit
that referenced
this pull request
Mar 17, 2026
* fix: auto-bootstrap Python engine before starting bridge Bridge.start() now calls ensureEngine() to download uv, create an isolated venv, and install altimate-engine before spawning the Python subprocess. resolvePython() also checks the managed venv path so the correct interpreter is used after bootstrapping. Previously, resolvePython() would fall through to system python3 which doesn't have altimate_engine installed, causing ModuleNotFoundError on first run. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * test: add bridge client tests for ensureEngine and resolvePython - Export resolvePython() from client.ts for direct unit testing - Test that ALTIMATE_CLI_PYTHON env var takes highest priority - Test that managed engine venv is used when present on disk - Test fallback to python3 when no venvs exist - Test that ensureEngine() is called before bridge spawn - Mock only bridge/engine module to avoid leaking into other tests Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ensureEngine()inBridge.start()before spawning the Python subprocess, so the managed venv withaltimate-engineis created automatically on first runenginePythonPath()as step 4 inresolvePython()so the managed venv's Python is used after bootstrappingModuleNotFoundError: No module named 'altimate_engine'that occurs when no local.venvexists and system python3 doesn't have the engine installedTest plan
.venvpresent — should auto-download uv, create venv, install engine, and start the bridge successfullyALTIMATE_CLI_PYTHONenv var set — should still use the explicit pathpackages/altimate-engine/.venv— should use the local dev venv (step 2) without triggeringensureEnginedownload🤖 Generated with Claude Code