Skip to content

fix(studio): harden training setup, lifecycle, and audio loading - #8103

Merged
danielhanchen merged 16 commits into
unslothai:mainfrom
Sneakr:train-page-fixes-and-hardening
Aug 8, 2026
Merged

danielhanchen merged 16 commits into
unslothai:mainfrom
Sneakr:train-page-fixes-and-hardening

Conversation

@Sneakr

@Sneakr Sneakr commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • hardens manual Hugging Face dataset subset and split handling
  • prevents configuration changes from racing an in-progress training start
  • scopes stop requests to the expected training job
  • improves cached and offline model/dataset handling
  • pins and verifies Spark-TTS, OuteTTS, and DAC dependencies
  • expands security scanning to the model subdirectories actually loaded
  • improves training progress GPU selection behavior

Scope

This follows the merged train-page rework and focuses on lifecycle, dataset, model-loading, offline, audio-loading, and security hardening.

Compatibility

Designed for browser and Tauri environments across Linux, macOS, and Windows.

Sneakr added 2 commits August 7, 2026 11:25
Scan every model load root before approving remote code, and pin third-party codec sources to verified revisions.

Align dataset option validation across the UI and backend, preserve manual drafts, and include edits in training start identity.

Require job-scoped stop requests and retain bounded early-cancel tombstones without unsafe eviction.
Preserve early start cancellations with bounded tombstones and explicit capacity handling for concurrent requests.

Pin and verify third-party audio sources and codec artifacts with safe archive extraction and offline cache migration.

Keep automatic evaluation data separate from every split included in a combined training instruction.

Keep training summaries and GPU progress state aligned with the active configuration through public feature exports.

Make route and lifecycle tests deterministic by isolating Hub reachability and executor behavior.
@Sneakr
Sneakr requested a review from danielhanchen as a code owner August 7, 2026 10:06
pre-commit-ci Bot and others added 2 commits August 7, 2026 10:10
Apply Alpaca response markers safely when completion-only training is enabled.

Skip optional runtime dependency installs while Studio is offline.

Limit causal-conv1d hooks to recognized model families without dropping supported architectures.

Disable known-broken TileLang dispatch when offline repair is unavailable.

Use cached GGUF and model-size metadata without offline Hub retries.
chatgpt-codex-connector[bot]

This comment was marked as resolved.

Detect causal-conv1d requirements from resolved model architectures before loading model code. Keep name matching as a fallback while excluding unrelated renamed checkpoints.
chatgpt-codex-connector[bot]

This comment was marked as resolved.

Allow registered start cancellations to reclaim the oldest expiring tombstone when unknown cancellation capacity is full. Preserve the hard capacity limit and 429 response for unregistered request IDs.
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: f9396601be

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

@unslothai unslothai deleted a comment from LeoBorcherding Aug 7, 2026
@unslothai unslothai deleted a comment from LeoBorcherding Aug 7, 2026
@unslothai unslothai deleted a comment from LeoBorcherding Aug 7, 2026
@unslothai unslothai deleted a comment from LeoBorcherding Aug 7, 2026
…or PR unslothai#8103

- /api/train/reset: an unscoped reset could force-terminate a run mid-cancel. The
  guard now refuses to touch a live run it cannot prove it owns. The field stays
  optional so pre-rework clients, which POST /reset with no body, keep working.
- ensure_dac_speech_weights: install the download into the pinned destination, so
  later loads hit the fast path instead of re-downloading and re-hashing 295 MB
  under the install lock.
- _requires_security_review_for_model: apply the same load_scan_target alias
  normalization the sibling remote-code check gained, else the Spark-TTS alias
  404s and fails open to "no review needed".
- _purge_package_bytecode: best effort. It runs without the install lock over a
  cache shared by the inference and training workers; 7 of 8 concurrent imports
  died on it. Also moved inside the try so a failure cannot strand the cache dir
  on sys.path, and snapshot sys.modules before the origin audit.
- commitSubset: clear the backing splits too, else the render-phase draft sync
  reads the previous subset's split back into the boxes it just reset.
- Fix two tests that fail on the branch: the DAC assertion pinned the old return
  value, and the causal-conv1d assertion matched call formatting.
danielhanchen added a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Aug 7, 2026
ensure_ssm_runtime deliberately skips causal-conv1d on win32 (no prebuilt wheel),
so the two install-order assertions only hold off Windows. Caught on a real
windows-latest runner.
@danielhanchen

Copy link
Copy Markdown
Member

I went through this one carefully and pushed a few fixes directly to the branch. Summary of what I checked, what I changed, and two things worth your call.

The problems this fixes are real

I ran the same scenario against the merge base and this branch rather than reasoning from the diff:

Scenario Before After
Cancel a start, then 70 more start requests reserved/pending, the cancelled start could still launch existing/rejected
Stale stop for an old job accepted with expected_job_id: None, killed whatever was running rejected
Bodyless reset while a job is mid-cancel reset plus one force_terminate on a job it did not own superseded, no terminate
train[101%:], train[abc], train-clean accepted, then crashed inside load_dataset 422 up front, train.clean.100 and train[:10%] still fine
Auto-eval with train[:50%]+validation[:50%] excluded only train, so it picked validation, which was already in the training data excludes both, picks test
auto_map in LLM/config.json invisible to the consent gate, so remote code ran with no prompt seen

That last one is the most valuable thing in the PR. Together with replacing two unpinned git clone --depth 1 of code that gets imported, plus an unpinned-revision download of a full-pickle .pth, this is a real supply-chain improvement. I did a cold network install and both committed tree digests reproduce from the pinned upstream commits, warm re-entry with every socket poisoned makes zero egress, and offline with an empty cache fails fast with a clear message.

The split grammar also holds up: it matches datasets.ReadInstruction.from_spec on a 76-spec corpus under both datasets 3.6.0 and 4.3.0, with no looser acceptances. Dropping hyphenated splits is correct, datasets.naming._split_re is ^\w+(\.\w+)*$ and real LibriSpeech splits are train.clean.100. I also confirmed streaming genuinely rejects train+validation on both datasets versions and against a real Hub dataset, so tightening that check turns a mid-run ValueError: Bad split into an up-front 422.

What I pushed

  1. /api/train/reset was still unscoped while /stop became mandatory-scoped. A bodyless reset could reach force_terminate on a run it did not own. I enforced the guard in reset_training_state instead of making the field required, so the wire contract is unchanged.
  2. ensure_dac_speech_weights never populated its own destination, so the fast path could never hit and every codec load re-downloaded and re-hashed 295 MB under the 300 s install lock. One line.
  3. _requires_security_review_for_model missed the load_scan_target normalization its sibling three lines up just gained, so the Spark-TTS alias 404s and fails open to "no review needed".
  4. _purge_package_bytecode runs without the install lock over a cache shared by the inference and training workers. Eight concurrent imports against the real installed runtime killed seven of them with FileNotFoundError. Made it best effort, moved it inside the try so a failure cannot strand the cache dir on sys.path, and snapshotted sys.modules before the origin audit.
  5. commitSubset did not clear the backing splits, so the render-phase draft sync read the previous subset's split back into the boxes it had just reset. Confirmed in a live browser and on the wire.
  6. Fixed two tests that were failing on the branch, and made the SSM runtime tests Windows aware (ensure_ssm_runtime deliberately skips causal-conv1d on win32, but the assertions did not).

Two things for you to decide

Requiring expected_job_id on /stop breaks existing installs. Every frontend built before the train-page rework sends {"save": true} with no job id, so those clients now get 422 expected_job_id: Field required and the Stop button stops working while training carries on. In the browser a refresh fixes it, index.html is no-store and assets are content-hashed. The desktop app does not self-heal: it loads a bundled frontend and unsloth studio update only upgrades the Python backend, so a user who skips the app update has a permanently broken Stop button. I left the behaviour as you wrote it since the security argument is sound, but studio/MCP.md still does not mention the new required argument and there is no changelog entry.

Scope. The last few commits add completion masking, a new 111-line utils/ssm_runtime.py, causal-conv1d kernel resolution, GPU selection and flash-attn work on top of a PR already covering supply chain, lifecycle, dataset grammar and security scanning. That is the least reviewed part of the diff and it is growing while under review. I would split it out.

Testing

  • Backend suite 17794 passed, 0 failed; frontend typecheck clean, 738 passed.
  • Real Studio install, one GPU, small LoRA run: double-click start and duplicate start_request_id both yield exactly one worker, a second different id is refused, stop/reset/cancel are all idempotent across three calls, a stale stop for job A returns 409 with job B's worker PID unchanged, and a bodyless reset mid-cancel returns superseded with the worker still alive.
  • Cross-OS on real runners: ubuntu-latest and macos-14 green. Windows surfaces two test-only problems, the SSM ordering one I fixed, and test_third_party_source.py hitting the Windows path limit through pytest's deep tmp_path (error: unable to write file .git/objects/...: Filename too long). That one is confined to _install_checkout, which is unreachable while both specs set archive_url, so it is a test portability issue rather than a product bug, but it is worth shortening those fixture paths.
  • Hardware: [Windows, Linux, WSL, macOS] x [NVIDIA, AMD, CPU-only] all pass, Linux/NVIDIA on real hardware and the rest via stub-torch environments. No new torch.cuda.* call without a guard.

Smaller things, not blocking

  • explicit_separate_eval = bool(eval_split and eval_split != train_split) in worker.py and trainer.py is still a raw string compare, so train+validation with an explicit validation eval still contaminates eval. Pre-existing, but it is the same asymmetry you fixed on the auto-detect side.
  • The os.walk rewrite is a genuine improvement, a symlinked directory full of .py used to be silently skipped. But a pruned HF blob or a symlinked model subdirectory is now a permanent approvable=False block whose message tells the user to retry when the repo is reachable, which is the wrong advice for local corruption.
  • An offline user with an existing Spark-TTS or OuteTTS clone is hard blocked, since a shallow clone of a moving branch cannot match the pinned digest. Inherent to pinning, worth a release note.
  • The archive path has no fallback to _install_checkout, so a network where git works through a proxy but plain HTTPS to github.com does not now fails.

- captureTrainingStartInputs now delegates to createTrainingStartInputIdentity,
  so the normalize/flags assertions belong against training-start-inputs.ts.
- resetTraining takes a RequiredTrainingJobScope and always sends the body, which
  is stronger than the hasScope branch the contract pinned.

Both fail on the branch today; caught by tests/studio, which the studio backend
job does not cover.
@danielhanchen

Copy link
Copy Markdown
Member

Follow-up: the repo-root tests/studio tree caught two more contract failures that the studio backend job does not cover, and I have pushed fixes for both.

  • test_training_start_aborts_when_semantic_config_or_token_changes was failing on the branch before I touched it. captureTrainingStartInputs now delegates to createTrainingStartInputIdentity, so the normalizeTrainingStartPayloadForComparison and model-flag assertions belong against training-start-inputs.ts rather than the start-fresh-training-run.ts snapshot.
  • test_superseded_start_cleanup_scopes_both_backend_mutations was my fault. The contract pinned the literal const hasScope = scope?.expectedJobId !== undefined, which my resetTraining change removed. The new signature takes a RequiredTrainingJobScope and always sends the body, so I updated the assertion to match the stronger shape.

tests/studio is now 2646 passed, with three pre-existing test_studio_gguf_export_script_pin.py failures that also fail on the merge base and are unrelated to this PR.

Two notes on CI. The runs on the current head were all cancelled about three minutes in by the capacity sweeper rather than failing, so there is no upstream signal yet; it should come back on the next push. In the meantime I replicated the full workflow suite on a staging fork against this exact code and everything is green except the Windows path-length issue I mentioned: Backend CI, Frontend CI, Lint, Unsloth API CI, Unsloth UI CI, Windows Unsloth UI/API/GGUF CI, Mac Studio UI + API + Update CI, Mac Studio GGUF CI, MLX CI on Mac M1, Tauri CI, GGUF CI, Startup profile.

…unslothai#8103

Corrects four things in my earlier commits on this branch.

Unscoped /api/train/reset returned "superseded" (HTTP 200) for a live run. The
pre-rework cancel dialog chains stopTrainingRun then a bodyless reset, so an older
client read that 200 as success and cleared its UI while training kept running.
Return "active" (409) instead: same answer a live run already gives, and one those
clients already handle. It still never force-terminates, so a bodyless reset landing
between current_job_id being set and _cancel_requested being cleared cannot kill the
run that just started.

The bytecode purge was made best-effort, but it is the only thing stopping a stale
or planted .pyc shadowing a verified .py: the manifest skips __pycache__ and the
origin audit reads __file__, which still names the .py. Tolerate only
FileNotFoundError, the real concurrent-purge race, and let PermissionError fail the
load again.

The DAC fast path copies 295 MB inside the hub cache with only Timeout caught, so a
full disk turned a hash-verified download into a hard failure. Fall back to the
verified hub path on OSError.

commitSubset cleared both splits, but setDatasetSubset already does that; the extra
setDatasetSplit(null) only cost a runDatasetCheck against an assumed "train" split.
@danielhanchen

Copy link
Copy Markdown
Member

Pushed 4e5389c21, which corrects four things in my own earlier commits on this branch. Three of them were regressions I introduced while reviewing, so flagging them explicitly rather than folding them in quietly.

1. Unscoped reset was a silent 200 on a live run

My expected_job_id is None guard in reset_training_state returned "superseded", which the route maps to HTTP 200. I had assumed pre-rework clients only ever reset a finished run. That is not true: the pre-rework cancel dialog chains

void stopTrainingRun(false).then((ok) => { if (ok) { void dismissTrainingRun(); } })

and dismissTrainingRun is a bodyless POST /api/train/reset, issued exactly while the run is active. An older client only checks response.ok, so it read that 200 as success and called resetRuntime() while training was still going.

Now returns "active" (409), which is the same answer a live run without a cancel already gives, and which those clients already handle (they surface "Training still active" and resync). It still never force-terminates, so the race this guard was for is still closed: _cancel_requested is cleared at training.py:1758, after current_job_id is set at :1715, and a bodyless reset landing in that window would otherwise kill the run that had just started.

Worth noting this is not only a stale browser tab. The desktop app bundles its own frontend (frontendDist: "../frontend/dist") while unsloth studio update upgrades the backend separately, and only a minimum backend version is enforced, so a newer backend under an older app is a supported configuration.

2. Bytecode purge was failing open

I had made _purge_package_bytecode best-effort with ignore_errors = True, on the reasoning that the manifest and the origin audit are the real defences. They do not cover this case:

  • _runtime_manifest skips every __pycache__/*.pyc and _valid_runtime drops __pycache__ from its check, so the runtime digest is identical with and without a planted .pyc and no reinstall is triggered.
  • the origin audit reads __file__, which still names the .py even when the code came from the .pyc.

So the purge was the only thing preventing a .pyc from shadowing a verified .py. It now suppresses only FileNotFoundError, which is the genuine concurrent-purge race that motivated the change; PermissionError fails the load again, as it did in your original.

3. DAC fast path could fail a verified download

_install_verified_artifact copies the 295 MB artifact a second time inside the hub cache, and only Timeout was caught around it. An OSError, realistically ENOSPC right after pulling 295 MB, escaped ensure_dac_speech_weights where the previous code returned the already hash-verified download and loaded fine. Now falls back to the verified hub path on OSError.

4. Redundant split clearing in commitSubset

setDatasetSubset already patches { datasetSubset, datasetSplit: null, datasetEvalSplit: null }, so the draft sync compares null against null and cannot read the previous subset's value back. The extra setDatasetSplit(null) was not free: it runs runDatasetCheck(datasetName, "train") for any online non-cached dataset, which sets isCheckingDataset and on failure surfaces datasetUnverified. Both lines removed.

Verification

  • studio/backend: 17828 passed, 87 skipped
  • repo-root tests/studio: 2672 passed, 3 skipped
  • studio/frontend: npm run typecheck and npm test clean

Two tests of mine pinned the buggy behaviour and were rewritten: test_bytecode_purge_tolerates_an_unwritable_runtime became test_bytecode_purge_fails_closed_when_a_pyc_survives, and the unscoped-reset assertion in test_training_cached_start.py now expects "active".

On the rest of the branch

I went back over the commits added during review and they hold up.

af6827d78 does not perturb the non-SSM path: 13 real config shapes (llama, qwen2/3/3_moe/2_5_vl, gemma2/3, mistral, phi3, gpt_oss, deepseek_v3, smollm) all resolve False, identical to the previous name gate, while 12 SSM families resolve True including four the old gate missed. import utils.ssm_runtime pulls in none of torch, mamba_ssm, causal_conv1d, transformers or triton, so the absent-kernel and off-NVIDIA cases are fine, and 12 degenerate configs fall back without raising. The config walk collects model_type from every nested dict, so one known-non-SSM nested type can veto the whole decision. I could not construct a shipping model that hits it, but narrowing if False in source_requirements to the top-level model_type would close it if you want the belt and braces.

The offline half of 72ee10d13 leaves online and warm-cache users byte-identical. detect_gguf_model_remote offline returns the same None as before, minus three hub attempts and three seconds of backoff.

On the completion masking half: the five new unit tests all stub train_fn, so none of them check the resulting labels. I ran the real train_on_responses_only through a real SFTTrainer with a real tokenizer against DEFAULT_ALPACA_TEMPLATE, and it is correct: 42 of 45 tokens masked, the supervised span contiguous, and the trained-on text exactly 'Paris.<|im_end|>'. Both alpaca markers resolve to findable token subsequences at identical offsets under the Llama 3.2 and Qwen 2.5 tokenizers.

One thing I would still raise: the last few commits add completion masking, a new ssm_runtime.py, kernel resolution and GPU selection on top of a PR that already covered four separate concerns. That is the least-reviewed part and it grew during review. Splitting it out would make it much easier to land.

…lothai#8103

Two corrections to 4e5389c.

commitSubset: I removed setDatasetEvalSplit(null) because setDatasetSubset already
nulls datasetEvalSplit. It does, but it never resets evalSteps, and
setDatasetEvalSplit is not a plain setter: it zeroes evalSteps and runs
streamingCompatiblePatch. Without it, changing the subset left evaluation armed with
no split, which routes/training.py rejects with 422 once streaming is on, and which
silently auto-detects an eval split otherwise. Restored. setDatasetSplit(null) stays
out, since its only unique effect was a runDatasetCheck against an assumed "train".

Unscoped reset: returning "active" for every live run was too broad. The pre-rework
cancel dialog only dismisses after stopTrainingRun succeeded, so _cancel_requested is
already set and clearing the UI is right; 409 there just wedged the overlay behind a
"Training still active" toast. Now 409 only when no stop was requested, which is the
stale-tab case the change was for. Still no force_terminate on an unscoped reset.

Also covers the __pycache__ branch of the purge, which is the route a planted .pyc
actually takes; the existing test only reached the top-level .pyc loop.
@danielhanchen

Copy link
Copy Markdown
Member

Pushed 65b2cd8aa, correcting two regressions I introduced in 4e5389c21. Both were mine, not yours.

1. commitSubset needed setDatasetEvalSplit(null) after all

I removed it on the grounds that setDatasetSubset already nulls datasetEvalSplit. It does, but it never resets evalSteps, and setDatasetEvalSplit is not a plain setter:

setDatasetEvalSplit: (datasetEvalSplit) => {
  const evalSteps = datasetEvalSplit ? 0.1 : 0;
  const streamingPatch = streamingCompatiblePatch({ ...state, datasetEvalSplit, evalSteps });
  setUserEdit({ datasetEvalSplit, evalSteps, ...streamingPatch });
  notifyStreamingCompat(streamingPatch);

So after my change, changing the subset left evalSteps: 0.1 with eval_split: null. Repro: an HF dataset needing manual entry, set subset plus split plus eval split, turn streaming on, change the subset, press Start. routes/training.py:1354 rejects it with

422  dataset_streaming with evaluation requires a separate eval_split.

Non-streaming is milder but still wrong: eval_steps stays at 0.1 with no split, so the trainer auto-detects an eval split for someone who had evaluation switched off. Nothing repairs it client side, because the evalSplit blocker in dataset-panel-helpers.ts only gates turning streaming on, not the state going invalid afterwards.

Restored. setDatasetSplit(null) stays removed, since its only unique effect really was the runDatasetCheck against an assumed "train" split.

2. The unscoped reset 409 was too broad

Returning "active" for every live run was over-correction on my part. The pre-rework cancel dialog is

void stopTrainingRun(false).then((ok) => {
  if (ok) { void dismissTrainingRun(); }

so the bodyless reset only fires after the stop already succeeded. _cancel_requested is set, the run is genuinely going away, and clearing the UI is the correct outcome. My 409 turned that into a spurious "Training still active" toast with the overlay stuck open.

Now gated on the cancel flag:

  • unscoped, live, no stop requested: "active" (409). This is the stale-tab case, and it matches what upstream already returned.
  • unscoped, live, stop already requested: "superseded" (200), so the legacy dismiss clears.

Neither path calls force_terminate, so the race is still closed: _cancel_requested is cleared at training.py:1758, after current_job_id is set at :1715, and a bodyless reset landing in that window must not kill the run that just started.

Test gap

test_bytecode_purge_fails_closed_when_a_pyc_survives only reached the top-level .pyc loop, not the shutil.rmtree(__pycache__) branch, which is the route a planted .pyc actually takes. A PermissionError reintroduced on the rmtree line alone would have passed. Added a case for that branch, and the reset test now covers both outcomes rather than one.

Verification

  • studio/backend: 17840 passed, 87 skipped
  • repo-root tests/studio: 2672 passed, 3 skipped
  • studio/frontend: npm run typecheck clean, 738 tests pass

Two things left open, both pre-existing

ensure_dac_speech_weights has a sibling legacy-migration branch at third_party_source.py:900 that still calls _install_verified_artifact(legacy, destination) unguarded, so the full-disk failure mode I fixed for the download path is still there for the migration path.

The bytecode purge failing closed is deliberate, but it is a real availability trade worth stating plainly: a genuinely read-only or root-owned runtime tree now fails every codec load with no attacker present, and on Windows a file with an open handle cannot be unlinked, so an antivirus or indexer touching a .pyc in that deliberately unlocked shared tree can fail a load. I think fail-closed is right for a pinning mechanism, since the manifest skips __pycache__ and the origin audit reads __file__, but if you would rather have availability there the alternative is to keep the tree locked during import instead.

danielhanchen added a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Aug 8, 2026
chatgpt-codex-connector[bot]

This comment was marked as resolved.

danielhanchen added a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Aug 8, 2026
danielhanchen added a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Aug 8, 2026
…lothai#8103

Two fixes plus the regression tests the earlier lifecycle fixes shipped without.

Cancelling the active start at tombstone capacity reclaimed a slot by deleting the
soonest-expiring entry. Expired ones are already pruned a few lines above, so that
entry was always live, and dropping it let a delayed /start spawn the job it had
cancelled. Reserve capacity instead: only the owner of the active start reaches that
branch and there is at most one, so the table lands at cap + 1 rather than forgetting
a cancellation. Unregistered ids still hit the hard cap.

ensure_dac_speech_weights migrated a pre-existing legacy file with an unguarded copy,
so a hub cache that cannot absorb a second 295 MB copy failed weights that had already
passed size and sha256. Same fallback the download branch below it already uses.

Tests: renamed and local SSM checkpoints resolving from config rather than name, the
owner of an active start staying cancellable at capacity, live cancellations surviving
that cancel, and the full-disk legacy DAC fallback.
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Aug 8, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Aug 8, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Aug 8, 2026
pre-commit-ci Bot and others added 2 commits August 8, 2026 06:25
…8103

Cross-OS CI caught 14 failures on windows-latest, all of them the pinned checkout
dying with "error: unable to write file ...: Filename too long". Git for Windows still
enforces MAX_PATH unless told otherwise, and the cache nests a 40-char revision, a
staging dir and .git/objects under the studio home. A venv-inferred home already
measures about 253 of the 260 characters, so a slightly longer user or install path
fails on a normal Windows machine, not just under the deeper pytest tmp dir.

Passed per invocation with -c so no user or system Git config is touched, and it is a
no-op off Windows.
danielhanchen added a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Aug 8, 2026
chatgpt-codex-connector[bot]

This comment was marked as resolved.

… checkouts for PR unslothai#8103

Three fixes, two of them on my own previous commit.

Moving the owner cancel from evict-oldest to a one-slot overshoot also changed what the
hardcoded reclaim_capacity=True on the pending non-owner branch did: it used to evict,
so the table stayed at the cap, and it started overshooting instead. Start plus cancel
could then be repeated to grow it without bound (1224 entries against a cap of 1024).
That branch now takes the plain reservation, so the extra slot belongs to the owner of
the active run alone.

The DAC legacy fallback sat behind destination.parent.mkdir() and the install lock, both
of which need a writable cache, so a read-only or full hub cache raised before weights
we can already verify were ever looked at. Fall back at both points, and only to an
artifact that passes the same size and sha256 check.

Cross-OS CI then caught replacing a pinned checkout failing on windows-latest with
WinError 5: Git marks .git/objects read-only and Windows will not delete a read-only
file, so any repair or revision change died there. Clear the attribute and retry, only
when the path is genuinely not writable, so an open handle still surfaces.
danielhanchen added a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Aug 8, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Aug 8, 2026
@unslothai unslothai deleted a comment from Sneakr Aug 8, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Aug 8, 2026
@unslothai unslothai deleted a comment from Sneakr Aug 8, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Aug 8, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Aug 8, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Aug 8, 2026
@unslothai unslothai deleted a comment from Sneakr Aug 8, 2026
@danielhanchen

Copy link
Copy Markdown
Member

@codex review

1 similar comment
@danielhanchen

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: d5f102b45f

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

danielhanchen added a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Aug 8, 2026
@danielhanchen
danielhanchen merged commit 0b147fd into unslothai:main Aug 8, 2026
52 of 56 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants