Repository navigation
Guard Windows Studio installs against active runtimes - #7764
Merged
danielhanchen merged 47 commits intoAug 7, 2026
Merged
Conversation
Etherll
pushed a commit
to Etherll/unsloth
that referenced
this pull request
Aug 3, 2026
Etherll
pushed a commit
to Etherll/unsloth
that referenced
this pull request
Aug 3, 2026
Etherll
pushed a commit
to Etherll/unsloth
that referenced
this pull request
Aug 3, 2026
Etherll
pushed a commit
to Etherll/unsloth
that referenced
this pull request
Aug 3, 2026
Etherll
pushed a commit
to Etherll/unsloth
that referenced
this pull request
Aug 3, 2026
Etherll
pushed a commit
to Etherll/unsloth
that referenced
this pull request
Aug 3, 2026
The 32-bit leg fired one scan against a probe that lives about five seconds, while a WOW64 shell start plus the Add-Type compile regularly costs more than that, so it read an empty list on a Windows runner. Give the probe a long life and retry like the 64-bit sibling already does. The assertion is unchanged.
|
Codex Review: Didn't find any major issues. Breezy! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Codex Review: Didn't find any major issues. 🎉 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
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
Guard Windows Studio installs against processes that are already using the managed environment.
Before rollback or replacement starts, the installer now acquires its safety locks, checks confirmed executable identities, and stops with a clear warning when Studio or another managed process is active. If no managed executable is active, installation proceeds normally. Tauri desktop backend starts and updates use the same native Windows mutex, so they cannot enter during installation.
Motivation
The desktop app and manual installer both operate on
%USERPROFILE%\.unsloth\studio\unsloth_studio. Replacing that environment while its Python backend is active can leave the original path incomplete while the healthy environment remains in a rollback directory.uv --cleardoes not solve files that are still in use.Changes
bin\unsloth.exeshim.Scope
The direct terminal decision is intentionally snapshot-based: a process already active when installation begins is rejected. A new
unsloth studiocommand launched after that scan is not atomically gated before managed Python starts; closing that separate edge would require replacing the installed console shim with a stable native launcher. This PR does not add that launcher. Tauri desktop starts are atomically coordinated because their launcher is already native.Non-Windows behavior is unchanged.
Validation
python -m pytest tests/python/test_studio_runtime_gate.py tests/python/test_windows_installer_concurrency_guard.py tests/python/test_windows_python_venv_hardening.py unsloth_cli/tests/test_studio_run_parallel_flag.py -q: 118 passed.cargo test --manifest-path studio/src-tauri/Cargo.tomlwith the test frontend override: 115 passed.git diff --check: passed.