unsloth/studio/backend/hub/tests
Daniel Han d6d8b8b1a6 Fix the lost-generation proof set, the settle timeout and the hub inventory's diffusion gates
Seven fixes from the latest review round on the Images page and the hub cache inventory.

Images page:
- The lost-POST settle path built its "already seen" gallery id set inside the catch, after
  the request failed. By then the earlier runs of the same batch had already prepended their
  records, so run 2 could accept run 1's image as proof that its own request reached the
  backend. The set is now captured once before the first POST and grows with every record the
  batch produces.
- settleLostGeneration fell out of its SETTLE_MAX_MS loop and returned normally, so a wedged
  generation was counted as done and the next run started against a busy backend. It now
  throws on timeout.
- Restoring a recipe cleared the ControlNet selection but left the workflow tab and the
  init / mask / reference images pointing at whatever was loaded, so the next Generate
  conditioned on an unrelated image. It now clears all of them and returns to Create.
- The download plan omitted the adapter selection the load itself bakes in. A baked LoRA
  forces the dense build path, so the plan described a different file set than the load that
  followed and the rest was pulled inline, outside the download manager. Both now derive the
  list from one helper.

Hub cache inventory:
- A download for a repo an Images or Video load is staging was allowed to start: only the
  llama.cpp loader was consulted. Both diffusion backends already expose loading_repo_ids for
  the delete guard, and the download guard now reads them too.
- A companion-only prefetch (pipeline manifest plus VAE and text encoder, no transformer)
  passed the snapshot-partial check, since every file its manifest expected did arrive, and
  was advertised as on-device although from_pretrained cannot load it.
- The single-file flag never reached the picker through the hub inventory path, so a
  checkpoint-only diffusion repo read as a full pipeline and failed after the handoff.

The two pipeline-shape helpers now live in hub/utils/inventory_scan.py so /api/models/cached
and the hub inventory classify the same repos the same way.
2026-07-27 02:45:24 +00:00
..
conftest.py feat(studio): Hub + Download Manager (#5916) 2026-06-09 04:11:24 -07:00
test_dataset_services.py Studio: add configurable model download location (#7274) 2026-07-23 01:34:38 -07:00
test_download_lifecycle.py fix(studio): recover stalled Hub downloads over HTTP (#6858) 2026-07-17 19:32:03 +03:00
test_download_manifest_scoping.py Studio: add configurable model download location (#7274) 2026-07-23 01:34:38 -07:00
test_empty_variant_folder.py Studio: add configurable model download location (#7274) 2026-07-23 01:34:38 -07:00
test_model_services.py Fix the lost-generation proof set, the settle timeout and the hub inventory's diffusion gates 2026-07-27 02:45:24 +00:00