Skip to content

Studio: honor UNSLOTH_HOME in installers - #14293

Merged
Lyxot merged 4 commits into
unslothai:mainfrom
oobabooga:fix/studio-unsloth-home
Oct 20, 2026
Merged

Lyxot merged 4 commits into
unslothai:mainfrom
oobabooga:fix/studio-unsloth-home

Conversation

@oobabooga

@oobabooga oobabooga commented Oct 19, 2026 •

Copy link
Copy Markdown
Member

With only UNSLOTH_HOME set, the installers put Studio's venv in the default directory, but the CLI looks in <UNSLOTH_HOME>/studio. Linux and macOS finish installing, then fail to launch with Unsloth Studio not set up. Windows fails during setup because it cannot find the venv.

Make both installers and setup scripts use <UNSLOTH_HOME>/studio. UNSLOTH_STUDIO_HOME and STUDIO_HOME still take precedence. On Linux and macOS, the installer writes <UNSLOTH_HOME>/llama.cpp to the existing studio/share/studio.conf, which the launcher reads on startup.

Windows setup reuses Python from that venv before looking for system Python. Direct install.sh --tauri runs reject custom Studio paths because the desktop cannot find them. The CLI keeps its fallback for older installations.

Validation:

  • Live A/B on Linux, macOS and Windows: reproduced the failures above; with this change, fresh installs launch and generate text from a GGUF. Windows logs: before, after.
  • Verified launch from a new shell and after unsloth studio update. Uninstall with UNSLOTH_STUDIO_HOME set removes the installed runtimes and preserves unrelated files.
  • 51 focused tests passed, including 22 regression cases that fail before the fix. Native macOS and Windows PowerShell 5.1 tests also passed.

Live installs used --local --no-torch. Training was not tested.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-20T09:16:28.553044Z ed678b4 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@oobabooga

Copy link
Copy Markdown
Member Author

Reached Codex review convergence at oobabooga#394.

@Lyxot Lyxot self-assigned this Oct 20, 2026
@Lyxot

Lyxot commented Oct 20, 2026

Copy link
Copy Markdown
Collaborator

Pushed 3009593: preserve existing default installs when UNSLOTH_HOME is set, and resolve relative PowerShell install paths before creating them. Expanded precedence and update regression coverage and shortened the changed comments.

Validation: 107 focused tests passed, all 17 targeted and 20 mechanical mutations were caught, and two independent full-branch reviewers reported no findings. The branch was 23 commits behind main and mergeable, so no main merge was needed.

@Lyxot

Lyxot commented Oct 20, 2026

Copy link
Copy Markdown
Collaborator

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3009593001

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

Comment thread install.sh Resolved
@Lyxot

Lyxot commented Oct 20, 2026

Copy link
Copy Markdown
Collaborator

@codex review

Please review the current head and leave a normal confirmation comment if you don't find any major issues, so this review round has a linkable result.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6d3e1b9998

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

Comment thread install.ps1 Resolved
@Lyxot

Lyxot commented Oct 20, 2026

Copy link
Copy Markdown
Collaborator

@codex review

Please review the current head and leave a normal confirmation comment if you don't find any major issues, so this review round has a linkable result.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: ed678b44e2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

@Lyxot

Lyxot commented Oct 20, 2026

Copy link
Copy Markdown
Collaborator

Pushed three focused fixes (3009593001, 6d3e1b9998, ed678b44e2):

  • Preserve existing installer-managed environments when UNSLOTH_HOME changes, including the update handoff.
  • Resolve Windows relative roots against the PowerShell working directory before Tauri validation and directory creation.
  • Accept fresh relative spellings of the default Tauri root while retaining the explicit error for custom roots.
  • Strengthen behavioral coverage for all environment-variable precedence combinations, legacy installs, spaces, tilde paths, and Tauri validation.

Both review findings were reproduced, fixed, and resolved. Codex converged on ed678b44e2: Didn't find any major issues. Local validation passed all 118 focused tests, targeted mutation checks, and full-branch reviewer gates.

Fork staging #181 used the exact original head and base SHAs and is now closed. CI checked: 75 passed, 6 skipped, no test failures. Passing runs include Backend CI, macOS install matrix, Windows PowerShell 5.1/7, and cross-platform updates.

CI limitation: six jobs still have no assigned runner after a retry: three macOS clean-install legs and the claude/opencode/dsh agent-connection legs. These jobs have not run, so this is not a fully green CI result. Their runs are Clean machine install and Local Agent Guides CI.

The branch is mergeable and 27 commits behind main, below the requested merge threshold. No main merge or unrelated scope changes were added. The installer-only change does not need an mlx label.

@Lyxot Lyxot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rechecked the current head: all 83 executed CI checks passed, review threads are resolved, and the installer/CLI compatibility fixes look good to merge.

@Lyxot
Lyxot merged commit e72a79f into unslothai:main Oct 20, 2026
danielhanchen added a commit that referenced this pull request Oct 21, 2026
…ender ML false positive) (#14520)

## Summary

On main, VirusTotal's Microsoft engine flags `studio/setup.ps1` as
`Trojan:Script/Wacatac.C!ml` (engine 1.26090, signatures 2026-10-20).
That is the Windows Defender cloud machine-learning verdict. Every other
engine is clean. `setup.ps1` runs on every Windows install and `unsloth
studio update`, and PowerShell passes the script text to AMSI before it
runs it. If the endpoint agrees with this verdict, it can stop the
install partway through.

This PR changes one comment and no code.

## How it was found

The file was scanned at each step between the last clean main and the
current one:

| `studio/setup.ps1` | sha256 | Microsoft | engines |
|---|---|---|---|
| main `d9aded3801` | `c90a3460...` | clean | 0 / 61 |
| after #14293 (UNSLOTH_HOME) | `1a7529b6...` | clean | 0 / 61 |
| after #14473 (Unsloth Studio wording), current main | `c3bd31a3...` |
`Trojan:Script/Wacatac.C!ml` | 1 / 61 |
| current main with the three #14473 strings reverted | `1a7529b6...` |
clean | 0 / 61 |
| current main with the old 5-line comment restored | `0820e9d2...` |
clean | 0 / 61 |
| this PR | `f752d87c...` | clean | 0 / 61 |

Neither change was a problem alone. The detection needed both #14293
shortening a 5-line explanatory comment in
`Test-MasterRootNoteIsHonoured` to one line and #14473's "Unsloth
Studio" wording. Together they pushed the ML score over its threshold.
Nothing in either change downloads, runs or hides anything, so this is a
false positive.

## The change

The comment is restored as a 4-line explanation. Its wording is updated
for current behaviour: the old text said install.ps1 does not read
`UNSLOTH_HOME`, which #14293 made untrue. The #14473 branding stays as
it is.

## Testing

- `comment_tools.py check --strict-ext`: comment-only, no code changed.
- `studio/setup.ps1` parses with 0 errors in PowerShell.
- All 69 test files that read `studio/setup.ps1`: 9391 passed, 0 failed.

## Notes

- `!ml` verdicts are fragile, so a later edit to this file could tip it
over again. Re-scan `studio/setup.ps1` and `install.ps1` on VirusTotal
before each release.
- `studio/setup.sh` carries the same one-line comment. Defender does not
scan it on Windows, so it is left unchanged.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants