Repository navigation
Fix On Device model picker startup ordering - #6994
Conversation
|
Warning Gemini encountered an error creating the review. You can try again by commenting |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4de4dfbba4
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| ) : null} | ||
|
|
||
| {showCustom ? ( | ||
| {showCustom && cachedReady ? ( |
There was a problem hiding this comment.
Don't gate cached local folders on download scans
When a user has only custom/LM Studio/local-dir models cached, cachedReady still initializes false because alreadyCached only checks _cachedGgufCache and _cachedModelsCache. This new guard hides the already cached local sections on every picker mount until the unrelated downloaded-model API calls finish, so users briefly lose access to local models/folder controls despite the module-level local caches being populated; the same issue applies to the LM Studio and Local models guards below.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 830c254c1f
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 74267e3f84
ℹ️ 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".
|
Pushed the picker readiness follow-ups in Why this change is neededThe original startup gate waited for the downloaded-model requests but not local discovery. On a cold opening, Fine-tuned or the empty state could therefore render before Custom Folders, LM Studio, and Local Models arrived, causing the picker to reorder after it became interactive. Combining those requests into one startup snapshot exposed a second race on warm openings: an older startup result could resolve early and remain buffered behind a slower source. If the user deleted a model or changed a custom folder during that interval, the newer interactive refresh could apply first, then be overwritten by the buffered startup result. That could resurrect a deleted row, hide a newly added row, and leave keyboard options out of sync with the actual current inventory. How it was fixed
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 80c037e442
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8bd0841621
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9d0867d029
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 002a3e5549
ℹ️ 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".
| bounded(listCachedGguf(controller.signal)), | ||
| bounded(listCachedModels(hfToken || undefined, controller.signal)), |
There was a problem hiding this comment.
Preserve slow downloaded-cache scans after timeout
When either downloaded-cache scan takes longer than 30 seconds, passing controller.signal here aborts and permanently discards its eventual result while the picker remains open. Both backend handlers synchronously call _all_hf_cache_scans() (studio/backend/routes/models.py:3117-3121,3168-3178), so large or slow Hugging Face caches can exceed this bound; unlike the retained localRequest, these requests have no late-result path or retry, leaving downloaded GGUF or safetensors rows unavailable until a remount or another explicit refresh.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Thanks — this is accurate, but the 30-second cutoff is intentional here. Publishing a downloaded-cache result after the barrier releases would insert Downloaded / Other rows above already-visible Fine-tuned and local rows, recreating the row reorder and keyboard-focus instability this PR is fixing. Late local results are safe to retain because those sections render below the stable upper groups. If HF cache scans regularly exceed the bound, the smaller root-cause follow-up is to share or cache _all_hf_cache_scans() on the backend rather than publish downloaded rows late. Leaving this unchanged in this PR.
|
@codex review |
|
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". |
* Fix on-device model picker startup ordering * Fix on-device picker cached local remounts * fix(studio): stabilize on-device picker readiness * fix(studio): prevent stale picker refreshes * fix(studio): retry incomplete picker scans * fix(studio): preserve replacement picker readiness * fix(studio): preserve slow local scans --------- Co-authored-by: Long Yixing <[email protected]>
Summary
cachedReadystate used for downloaded rowsRoot cause
On cold startup, downloaded model rows waited for
cachedReady, but Fine-tuned and other lower On Device sections rendered immediately. If fine-tuned rows were available before the downloaded scan completed, Fine-tuned appeared as the first visible section, then Downloaded loaded above it and reordered the menu.Validation
npm cinpm run typecheckgit diff --check