unsloth/studio/frontend
Michael Han 0689bd3842
Studio: keep model downloads running across navigation and loads (#6573)
* Studio: keep model downloads running across navigation and loads

Downloads started from the chat model selector were tied to the staged
pick lifecycle, so they were cancelled in cases where Hub downloads keep
going. This makes the chat download flow behave like the Hub.

- Leaving the chat route or switching thread/project/new chat now detaches
  the staging UI but keeps the in-flight transfer running in the global
  download manager (new keepDownload option on abandonStagedModel).
- Staging a second pick no longer cancels the previous pick's download, so
  multiple models/variants can download at once.
- Picking a model to download while another model is loading now starts the
  download in the background instead of refusing, since a download is
  independent of a load.

* Studio: also background-download remote GGUF quants while a model loads

isDownloadableHubRepo (wantManagerDownload) excludes GGUF sources, so an
uncached remote GGUF quant picked from the chat selector while another model
was loading fell through to the 'Another model is already loading' toast
instead of downloading in the background. Treat an uncached remote hub GGUF as
a background download too, matching the staged-pick download path.

Addresses review feedback from gemini-code-assist and codex on PR #6573.

* Studio: only toast a background download once it actually starts

The chat background-download path (used when a model is already loading)
fired the "Downloading in the background" toast unconditionally, but
requestStart can return without starting a job: a cross-transport partial
records a conflict that is only resolvable from the Hub download card, and
a busy sibling variant returns after its own toast. So the user could be
told a download started when none did, with no way to resolve the conflict
from chat.

requestStart now reports an outcome (started/conflict/busy/error). The
chat path only shows the success toast on an actual start and points the
user to the Hub when a transport conflict needs resolving. The Hub card
surface keeps its existing behavior (it renders the conflict resolver, so
it ignores the outcome).

* Studio: report background-download outcome from real job state

The chat background-download toast trusted requestStart's optimistic
"started", but a start can no-op without throwing: startJob finalizes the
job as "error" when the backend refuses or fails apiStart, its peer guard
skips a fresh start, and hasActiveOrPendingStart trips on a snapshot, peer
variant, or pending preflight that is not this request. So the user could
be told a download started when none did.

Derive the outcome from the actual job state of the exact key
(running/cancelling = started, otherwise error/busy), so the toast only
fires for a transfer that is really live.

Also guard against re-downloading the model that is already loading: the
/load flow downloads before it sets the checkpoint, and that fetch is not
a download-manager job, so picking the same id+variant again would start a
second transfer against the same cache. Detect that pick and surface a
"this model is already loading" toast instead.

---------

Co-authored-by: Daniel Han <danielhanchen@gmail.com>
2026-06-22 08:51:14 -07:00
..
public chore(studio/frontend): normalize line endings to LF (#6012) 2026-06-12 03:51:59 -07:00
src Studio: keep model downloads running across navigation and loads (#6573) 2026-06-22 08:51:14 -07:00
.gitignore perf(studio): upgrade to Vite 8 + auto-install bun for faster frontend builds (#4522) 2026-03-25 04:27:41 -07:00
.gitkeep add studio root folder 2026-02-02 09:14:35 +00:00
.npmrc Studio: npm v12 readiness for install-script gating (#6128) 2026-06-10 02:20:27 -07:00
biome.json feat: add seed dataset support with configuration, preview, and builder utilities 2026-02-14 18:44:38 +01:00
components.json add studio root folder 2026-02-02 09:14:35 +00:00
data-designer.openapi (1).yaml save and import, and fixes 2026-02-04 14:32:49 +01:00
eslint.config.js Final cleanup 2026-03-12 18:28:04 +00:00
index.html chore(studio/frontend): normalize line endings to LF (#6012) 2026-06-12 03:51:59 -07:00
package-lock.json Bump hono to 4.12.21, fixes CVE-2026-47676 (#6014) 2026-06-11 16:45:10 +02:00
package.json Bump hono to 4.12.21, fixes CVE-2026-47676 (#6014) 2026-06-11 16:45:10 +02:00
tsconfig.app.json chore(studio/frontend): normalize line endings to LF (#6012) 2026-06-12 03:51:59 -07:00
tsconfig.json chore(studio/frontend): normalize line endings to LF (#6012) 2026-06-12 03:51:59 -07:00
tsconfig.node.json chore(studio/frontend): normalize line endings to LF (#6012) 2026-06-12 03:51:59 -07:00
vite.config.ts Fix Install commands for Windows + 1 line installs (#4447) 2026-03-19 02:09:09 -07:00