Skip to content

Studio: preserve partial state for canceled GGUF companions - #11018

Merged
mahiatlinux merged 4 commits into
unslothai:mainfrom
Etherll:codex/inline-gguf-companion-partial-437b6bf0ae35
Sep 18, 2026
Merged

mahiatlinux merged 4 commits into
unslothai:mainfrom
Etherll:codex/inline-gguf-companion-partial-437b6bf0ae35

Conversation

@Etherll

@Etherll Etherll commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator

Summary

Reconcile locally cached GGUF rows with same-quant download manifests and cancel markers. A complete main GGUF now remains partial when a required companion is incomplete, so an interrupted Xet companion returns Partial / Continue after reload instead of On device / Run.

The reconciliation preserves the real cached row, transport and resume semantics, state-only sibling rows, snapshot attribution, and ready-first default selection. Completed main and companion files still return a runnable variant.

Testing

  • studio/backend/hub/tests/test_model_services.py: 291 passed, 2 skipped
  • studio/backend/tests/test_mtp_drafter_companion.py: 245 passed, 4 skipped
  • GGUF local-resolution, partial-resume, row, and dependency-key suites: 150 passed
  • Deterministic cancel/reload reproduction: 1 passed
  • MTP download-visibility fixture: 2 passed
  • Ruff and git diff --check: passed

studio/backend/tests/test_cached_gguf_routes.py completed with 223 passed, 1 skipped, and 2 failures. Both failures reproduce unchanged on the exact base because the local Diffusers 0.38.0 environment does not provide Krea2Pipeline or ModularPipeline.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 15, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-15T13:50:02.289327Z f68c060 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

pre-commit.ci computed these and could not push them: its autofix step reports
`a conflict occurred when applying fixes to the pr`, so the check stayed red
with nothing landing.

Line wrapping only. comment_tools.py check: 2/2 OK, so the AST is unchanged.
studio/backend/hub/tests/test_model_services.py: 293 passed.
@danielhanchen

Copy link
Copy Markdown
Member

Confirmed this hits the path in studio/backend/hub/services/models/gguf_variants.py where _with_state_partials only appends state-only quants, so a cached main GGUF with an unfinished companion still reads as ready. Will get this reviewed.

@mahiatlinux

Copy link
Copy Markdown
Contributor

@codex review

@mahiatlinux

mahiatlinux commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Confirmed the companion-state fix and repaired one snapshot-attribution regression.

When the cache contains a complete Q4_K_M in an older snapshot, a newer Q8_0, and a cancelled newer Q4_K_M attempt, the original PR changes the reusable Q4_K_M from ready to partial. _with_state_partials now preserves readiness for a row supplied by a complete sibling snapshot. The existing regression test covers both pinned and unpinned listings.

Verification on Linux x86_64, Python 3.14.4, with pinned dependencies and separate credential-free sandboxes:

  • The 16 companion lifecycle cases fail on base bda17fd83c4b7fdbe24f83bda2c0477f402668c5 and pass on original head 66228651813568c4e46565c4792053170c5ee5f2: HTTP/Xet, cancellation markers present/absent, local/offline/fallback/pinned requests, and recovery after completion.
  • The sibling-snapshot regression passes on base, fails on the original PR, and passes with the repair.
  • Repaired model-services suite plus independent matrix: 311 passed. The same checks on the current-upstream review mirror: 312 passed.
  • GGUF variant-row and MTP companion suites: 325 passed.
  • Repository formatter with pinned Ruff 0.6.9, focused Ruff checks, and git diff --check: passed.

Repair landed as 5cc2035c3. Its tree exactly matches the tested repair 9e73b4a14. The final mirror review cleared 57948b74ebbf6d53f7b41434fd19f26be6ee2aba with no findings. Upstream CI is queued after the push.

Both screenshots show the production GgufDownloadCard from separate frontend builds, the real GGUF service, and identical seeded caches. Unrelated endpoints use fixture responses. This is component/service evidence. Each browser used separate contexts at 800 × 480; both composites were manually inspected.

Chromium 145.0.7632.6:

Base and repaired PR: cancelled MTP companion

Firefox 146.0.1:

Base and repaired PR in Firefox

Executed test logs, independent reproducer, pinned dependencies, API responses, and browser facts.

@mahiatlinux mahiatlinux left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Ready to merge, all manually checked.

@mahiatlinux
mahiatlinux merged commit 4e4ab12 into unslothai:main Sep 18, 2026
36 of 37 checks passed
shaojun pushed a commit to shaojun/unsloth that referenced this pull request Sep 29, 2026
…i#11018)

* Fix cached GGUF companion recovery state

* Apply the ruff kwarg-spacing formatter

pre-commit.ci computed these and could not push them: its autofix step reports
`a conflict occurred when applying fixes to the pr`, so the check stayed red
with nothing landing.

Line wrapping only. comment_tools.py check: 2/2 OK, so the AST is unchanged.
studio/backend/hub/tests/test_model_services.py: 293 passed.

* preserve readiness of complete sibling gguf variants

---------

Co-authored-by: danielhanchen <[email protected]>
Co-authored-by: mahiatlinux <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants