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.
Problem: Backend startup fails on Windows after a system restart with the error Backend environment check failed: No Python at .... This occurs because uv cannot locate the Python environment specified during installation. Additionally, the existing auto-repair mechanism fails to recover when the Python installation is corrupted (i.e., the directory exists but python.exe is missing).
Changes:
Consistent Environment Variables: Explicitly injected UV_PYTHON_INSTALL_DIR and UV_TOOL_DIR in
startBackend
to ensure the runtime configuration matches the installation configuration, allowing uv to correctly locate the cached Python environment.
Enhanced Auto-Repair: Improved the repair logic upon pre-flight check failure:
Added detection and cleanup for corrupted Python installations (where the directory exists but the executable is missing).
Added an explicit uv python install step before running uv sync to ensure the Python interpreter is correctly reinstalled.
What is the purpose of this pull request?