Skip to content

Studio: keep download restart toasts job-scoped - #10136

Merged
wasimysaid merged 5 commits into
unslothai:mainfrom
wasimysaid:fix-studio-download-toast-lifecycle
Sep 1, 2026
Merged

wasimysaid merged 5 commits into
unslothai:mainfrom
wasimysaid:fix-studio-download-toast-lifecycle

Conversation

@wasimysaid

Copy link
Copy Markdown
Collaborator

Summary

  • defer restart disclosure until the backend accepts the download and compose it with Xet/caller context in one keyed toast
  • dismiss restart/start notices on completion, navigation, cancellation, and same-route model selection, including delayed async raises
  • add behavioral lifecycle and notification regression coverage

Verification

  • node --experimental-strip-types --test tests/download-start-lifecycle.test.ts tests/download-start-toast.test.ts tests/xet-progress-notice.test.ts tests/xet-notice-reservation.test.ts tests/download-center-resume.test.ts
  • npm run typecheck
  • npm run build
  • deterministic worktree checks and pre-push gate

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 1, 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-01T09:41:14.084894Z 96fe281 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.

@wasimysaid

Copy link
Copy Markdown
Collaborator Author

@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: 022167e3b0

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

restorePreviousConfig();
return;
}
dismissStartToastsForModelSelection();

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 Invalidate toasts when staged picks are selected

Calling the invalidation only inside selectModel misses Chat's normal uncached-model selection path: stageOrLoad returns after setting pendingHubAutoLoad (chat-page.tsx:2910-2927) and does not invoke selectModel until the download completes. If a restart toast from an earlier job is visible and the user selects another uncached model on the same route, its epoch therefore remains valid and the stale toast stays visible or can appear after preflight, contrary to the new selection-scoping behavior. Trigger the invalidation at the actual picker/staging boundary as well.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed in 5eb72be: uncached staged picks now invalidate model start toasts at the picker boundary before stageOrLoad returns.

Comment on lines +110 to +112
for (const id of liveStartToasts.keys()) {
liveStartToasts.delete(id);
toast.dismiss(id);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P3 Badge Preserve unrelated dataset start notices

This sweep removes every managed-download start toast and invalidates every delayed raise, not just notices associated with a model pick. On the Hub, a dataset with an unresumable partial can raise the new restart disclosure; if the user then switches to the Models view without changing the /hub pathname and selects a model, this loop dismisses that still-accurate dataset-job notice (or prevents its in-flight raise) even though the dataset download remains active. Track the job kind/context and invalidate only model-selection notices.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed in 5eb72be: managed start toasts now retain their download kind, so model selection dismisses and invalidates only model notices while dataset notices remain active.

@wasimysaid

Copy link
Copy Markdown
Collaborator Author

@codex review

1 similar comment
@wasimysaid

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

Reviewed commit: 5eb72beba1

ℹ️ 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 Author

@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: a33a9c9319

ℹ️ 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 Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

Reviewed commit: 96fe281591

ℹ️ 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
wasimysaid merged commit 7466107 into unslothai:main Sep 1, 2026
33 of 36 checks passed
@wasimysaid

Copy link
Copy Markdown
Collaborator Author

Deterministic before/after UI evidence

Before and after download-start toast lifecycle

Using Chat's real model picker with unsloth/Qwen3.5-4B-GGUF, the scene drove the same accepted, non-resumable partial Xet start on both exact builds. Download transport/status/start responses were deterministic fixtures; no model bytes were downloaded.

Merge base PR head
SHA 71b7b30672b4 96fe2815912d
Visible start toasts 2 1
“Download is running” notices 1 0
“Restarting this download” notices 1 1

Observed: the merge base stacks separate “Download is running” and “Restarting this download” notices. The PR head shows one job-owned “Restarting this download” notice that combines restart, Xet-progress, and auto-load information.

Captured in headless Chromium at 1366×768. Both sides made exactly one transport-status request, one accepted download-start request, and one Xet-notice reservation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant