Skip to content

Studio: resume HTTP after Xet stall without a transport-conflict banner - #10045

Merged
wasimysaid merged 7 commits into
unslothai:mainfrom
Souravrajvi0:feat/xet-http-resume-conflict-dee2
Aug 31, 2026
Merged

wasimysaid merged 7 commits into
unslothai:mainfrom
Souravrajvi0:feat/xet-http-resume-conflict-dee2

Conversation

@Souravrajvi0

Copy link
Copy Markdown
Contributor

Fixes the desktop download loop reported in #10024.

After a Xet stall the watchdog falls back to HTTP, which leaves a .transport marker that no longer matches Auto/Xet. The next start from Chat, Video, or a staged Hub pick then returned conflict and showed Resume this download from Models — An earlier partial download used a different transport. Staging also parked the download hook on an idle repo id, which cancelled the conflict before the Hub card could show it.

This change:

  • Continues over HTTP when Auto/HTTP hits a leftover Xet or HTTP partial (Xet cannot byte-resume; HTTP fallback progress is kept).
  • Still asks only when the user explicitly chose Xet and a resumable HTTP partial exists.
  • Stops dropping a recorded conflict when the staged-download hook goes idle.

Auto and HTTP starts that find a leftover partial from the other transport
now continue over HTTP instead of blocking Chat/Video behind a Hub dialog.
Xet partials cannot byte-resume, and an HTTP partial from the stall fallback
should keep its progress. An explicit Xet preference versus a resumable HTTP
partial still asks. Staging no longer drops a recorded conflict when the
download hook parks on an idle repo id.
@danielhanchen

Copy link
Copy Markdown
Member

Confirmed the mismatch path in studio/frontend/src/features/hub/download-manager/transport-conflict.ts still parks a start on the Hub banner after the watchdog falls back to HTTP, so the direction looks right; this also removes the unmount cleanup in use-repo-download.ts, so could you confirm a recorded conflict still gets cleared when the card unmounts or the repo id changes?

Keep the download hook from wiping a staged Chat/Video conflict when it
parks on an idle repo id. The Hub card that shows the dialog still
clears the recorded conflict when it unmounts or the repo/variant key
changes.
Skip cancel only when Chat/Video staging parks the download hook on an
idle repo id. Clearing from the inner DownloadCard shell was wrong:
GGUF status and fallback swaps unmount that shell while the model card
is still on screen. Restore cleanup on the hook so leaving the card or
changing repo still drops the parked conflict.
@Souravrajvi0

Copy link
Copy Markdown
Contributor Author

Confirmed the mismatch path in studio/frontend/src/features/hub/download-manager/transport-conflict.ts still parks a start on the Hub banner after the watchdog falls back to HTTP, so the direction looks right; this also removes the unmount cleanup in use-repo-download.ts, so could you confirm a recorded conflict still gets cleared when the card unmounts or the repo id changes?
yes , it still gets cleared when the card unmounts or the repo changes. we only skip that for the idle Chat/Video hook so it doesn’t wipe the banner before Hub can show it.

@wasimysaid

Copy link
Copy Markdown
Collaborator

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 31, 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-08-31T13:38:14.099244Z b7172b5 Manual request
ℹ️ 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 44f1d0d1df

ℹ️ 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".

Comment on lines +130 to +135
const parked = repoIdRef.current;
if (
parked === "__staged_download_idle__" ||
parked === "__hub_autoload_idle__"
) {
return;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Clear preserved conflicts when staging a replacement

When a staged request for repo A records a conflict, clearing the queue changes this hook to the idle ID and this cleanup deliberately preserves A's conflict. If the user then stages repo B, the next cleanup is for the idle conflict key, so A is never cleared despite the intended repo switch behavior. The stale entry remains in the global store and can later show repo A's dialog and resume the superseded request; retain the last real conflict key so transitioning from idle to a new repo can cancel it.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Fixed in c8ea418: the hook now remembers the real conflict key while parked on an idle sentinel and clears it before a later real repo replaces it; the focused test covers both preservation and replacement cleanup.

@wasimysaid

Copy link
Copy Markdown
Collaborator

@codex review

1 similar comment
@wasimysaid

Copy link
Copy Markdown
Collaborator

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c8ea4188f0

ℹ️ 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".

parked === "__staged_download_idle__" ||
parked === "__hub_autoload_idle__"
) {
preservedConflictKeyRef.current = conflictKey;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Expose preserved scoped conflicts in the Hub

When an Images, Video, or Audio staged download hits the explicit-Xet/resumable-HTTP conflict, useStagedDownload stores it under a scoped variant such as @diffusion and then parks this hook on the idle ID. Preserving that key here does not make it resolvable from Models: SafetensorsDownloadCard observes only the null variant, while GgufDownloadCard observes a selected quant, so neither reads the scoped conflict and no dialog appears. The user is told to resume from Models, but the preserved request remains blocked; the Hub needs a way to discover/render the repo's scoped conflict rather than only retaining it in the store.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Fixed in b7172b5: Hub now prefers the exact conflict then falls back to a same-repo scoped conflict; dialog actions use the rendered key while lifecycle cleanup stays owner-keyed.

});
return "conflict";
}
if (siblingProbed && siblingTransport && siblingTransport !== action) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Re-evaluate fallback before rejecting an HTTP sibling

When Auto initially resolves to Xet, the requested variant has an HTTP partial, and another variant of the same repository is already downloading over HTTP, the earlier sibling check returns busy because it compares the sibling against the pre-fallback Xet mode. mismatchStartAction would subsequently select HTTP, and the backend explicitly permits concurrent same-transport variants, but execution never reaches this added action-specific check. Defer the transport-mismatch rejection until after the partial fallback is selected so this valid HTTP sibling case can start.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Fixed in b7172b5: Auto now defers the sibling mismatch decision until after partial fallback; explicit modes still reject early, and the final mode must match the sibling.

@wasimysaid

Copy link
Copy Markdown
Collaborator

@codex review

1 similar comment
@wasimysaid

Copy link
Copy Markdown
Collaborator

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: b7172b5ffc

ℹ️ 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".

@wasimysaid

Copy link
Copy Markdown
Collaborator

Before / after — live Studio

Pinned pre-fix fa150dc4e → Codex-approved head b7172b5ff, using the same model card, explicit Xet preference, and transport status has_partial=true, last_transport=http, resumable=false.

PR 10045 before and after

  • Before: the “Different transport mode” dialog blocks the request; start count 0.
  • After: no dialog; one Xet start is sent with use_xet=true, and the running download renders.
  • Browser console errors and request failures: none on either side.

@wasimysaid
wasimysaid merged commit c47645f into unslothai:main Aug 31, 2026
35 of 47 checks passed
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