Repository navigation
Studio: resume paused and interrupted model downloads on Windows - #16828
Conversation
… stops early (#16861) ## Summary `Chat UI Tests (chat)` on Linux has started failing on unrelated PRs with the same assertion in the floating monitor geometry check: ``` tests/studio/playwright_chat_ui.py:956, in exercise_floating_monitor_geometry AssertionError: [ui] FAIL: resize width: expected 296, got 260 ``` It failed 3 of the last 17 completed `Unsloth UI CI` runs (#16858, which only touches the bookmarks test, plus `inprocess-native-tool-formats` and `download-speed-limit`, the #16828 branch, which only touches backend hub code). #16828 also hit it once more with `got 256`, and a rerun passed. Playwright and Chromium are the same version (1.64.1) in passing and failing runs, and nothing under `studio/frontend` merged in the window where it started. The numbers point at the pointer drag, not the resize logic. The check drags the native grip with `mouse.move(..., steps = 10)` from 8 px inside the corner to 40 px past it. 260 is 256 plus the first 4 px step, and 256 is no step at all. So the native resize took at most the first pointer step and dropped the rest. The same step passes in the other 14 runs on the same code. ## Change `tests/studio/playwright_chat_ui.py`, the "resize width / height" step only. The drag target is an absolute point, so if the box is not at the wanted size after the drag, the test drags the grip again from wherever the corner is now, up to three drags, and logs a line when it retries. The width, height, left edge and top edge assertions after it are unchanged, so a resize that really stops following the grip still fails after the third drag. ## Testing - `python -m py_compile tests/studio/playwright_chat_ui.py`. - This PR's own `Unsloth UI CI` run exercises the step on Linux. - I could not reproduce the dropped steps locally. The change only adds the retry, so it cannot make a passing run fail.
…ns on Windows [skip ci]
|
@codex review |
1 similar comment
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2771406d76
ℹ️ 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".
| owned = _owned_by_this_account(descriptor) | ||
| except Exception: # noqa: BLE001 - an owner that cannot be read is not ours | ||
| owned = False | ||
| return None if owned else "owned by another user" |
There was a problem hiding this comment.
Reject link swaps before accepting Windows partials
On a Windows cache writable by another account that can create file symlinks (for example, with Developer Mode enabled), this can accept a handle obtained by following a swapped-in link. _open_stable_partial() only calls lstat() before os.open() when O_NOFOLLOW is unavailable, so an attacker can replace the checked partial with a symlink to a downloader-owned file between those calls; this ownership check then passes for the target. The resumed writer appends to, or truncates, that unrelated file before _still_the_written_file() runs, so the publication check cannot prevent the damage. Open Windows partials with atomic no-follow semantics and reject reparse points before enabling the shared writer.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in cdf21f9: without O_NOFOLLOW the open is now followed by an lstat identity check against the opened handle, so a link swapped in during the race is refused before any byte is written (O_APPEND, no truncate), with a regression test.
|
@codex review |
1 similar comment
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep it up! 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". |
On Windows, a model download that was paused, cut off by a network drop, or stopped by a crash or restart never continues where it left off. Pressing Continue shows "The earlier partial can't be resumed, so this download is starting over." and the whole file is fetched again from zero.
Studio reuses a partial file only when it can show that no second process writes it at the same time and that the current account wrote it. Both checks only existed for Linux and macOS. On Windows they now use the byte-range lock huggingface_hub itself takes there, and the file owner read from the open handle, with no new dependency. A partial owned by another account is still refused, and network drives still start over. Linux and macOS are unchanged.
Fixes #16810
Screenshots
Real Studio on windows-latest (staging CI), HTTP download of unsloth/Qwen3-1.7B-GGUF BF16, interrupted partway, then Continue.