Skip to content

Studio: forget deleted audio models once the Hub cache listing updates - #13630

Merged
danielhanchen merged 5 commits into
unslothai:mainfrom
Etherll:fix/inline-audio-delete-forget-48cc19c6
Oct 14, 2026
Merged

danielhanchen merged 5 commits into
unslothai:mainfrom
Etherll:fix/inline-audio-delete-forget-48cc19c6

Conversation

@Etherll

@Etherll Etherll commented Oct 13, 2026 •

Copy link
Copy Markdown
Collaborator

Follow-up to #13517.

What changed

  • The Audio page now records the time of each model delete and clears the delete marker only after a settled listing whose Hub cache fetches (GGUF and models) were both sent after that time. useHubInventory exposes this as hubCacheRefreshStartedAt.
  • The Audio page's inventory now passes includeUmbrellaFolders: true, so it sees audio.cpp folder rows.

Why

After a delete, the Audio page in Unsloth Studio could keep a deleted model as the remembered model. A Hub repo stayed hidden while missing and came back if downloaded again; a deleted audio.cpp folder stayed offered on the page. The local listing is not debounced, so it lands first next to the old Hub cache rows that still include the deleted repo. The old check retired the marker on the first settled listing with a new available set, which was that stale one, so the model was never forgotten. A Codex review comment on #13517 found this.

The second fix comes from the folder delete in #13519. Without folder rows, deleting one audio.cpp folder while other folders stay downloaded left that folder remembered.

Tests

  • tests/audio-page-policy.test.ts: 75/75 pass on this branch. The same file fails 5 tests on main (the new and updated tests).
  • Audio, inventory, hub and chat-search node tests: 954/954 pass.
  • npm run typecheck: clean.
  • Not run against a live Unsloth Studio instance.

Before / after (Unsloth Studio)

Two isolated Studios (merge base daab3bcd8 vs this branch 4fb5e6225) on the same fresh HF cache holding two audio.cpp folders, Piper-TTS-GGUF and KittenTTS-GGUF. Speak remembers Piper and nothing is loaded. Piper is then deleted from the Audio page's own model picker (On Device > More options > Delete), and the page is captured once the listings settle.

Audio page after deleting Piper-TTS-GGUF: before keeps offering it, after forgets it

  • Before: still reads "Piper-TTS-GGUF is not loaded. Pick it above to load it." and the saved Speak slot still holds audio-cpp/audio.cpp-gguf/Piper-TTS-GGUF.
  • After: "Select audio model" and "No TTS model loaded."; the Speak slot is cleared while the Clone slot keeps KittenTTS-GGUF.

… lands

The Audio page spent a delete marker on the first settled listing whose
available set was a new object. After a delete the undebounced local
listing lands first beside the old Hub cache rows, so the marker was
spent while the deleted repo was still listed and the remembered model
was never forgotten. Markers now keep the delete time and retire only
once both Hub cache fetches behind the listing were sent after it.

The page's inventory also asks for audio.cpp folder rows, so deleting
one folder while others stay downloaded forgets that folder.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 13, 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-10-14T16:49:48.485611Z 4fb5e62 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.

… the delete

A Hub cache fetch sent in the same millisecond as the delete could still
have read the old cache, and its late response stamped a start equal to
the delete time, spending the marker on stale rows. Require a strictly
later fetch start.
@danielhanchen

Copy link
Copy Markdown
Member

@codex review

1 similar comment
@danielhanchen

Copy link
Copy Markdown
Member

@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: 4fb5e62253

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

if (!inventory.settled || inventory.error || refreshStartedAt === null) return [];
return [...markers]
.filter(([, listedAtDelete]) => listedAtDelete !== inventory.available)
.filter(([, deletedAt]) => refreshStartedAt > deletedAt)

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 Replace wall-clock marker ordering with a monotonic token

When the system clock moves backward between the prior Hub scan and this delete (for example after an NTP correction, VM resume, or manual clock change), that old scan's refreshStartedAt can be numerically greater than the new Date.now() delete stamp, so this filter spends the marker immediately even though the listing predates the delete. The real post-delete listing then has no marker with which to call forgetModel, and re-downloading the repo resurrects the supposedly forgotten selection; use an inventory/version sequence or another monotonic ordering token instead (the negative-age handling in inventory-freshness.ts already recognizes this clock behavior).

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Not changing this: it needs the wall clock to step backward in the seconds between a Hub scan and a delete, and the outcome is only the old behaviour (the deleted model stays remembered), no crash or wrong load. Inventory hint reconciliation already orders refreshStartedAt against Date.now() stamps the same way.

@danielhanchen

Copy link
Copy Markdown
Member

@codex review

1 similar comment
@danielhanchen

Copy link
Copy Markdown
Member

@codex review

danielhanchen pushed a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Oct 14, 2026
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: 4fb5e62253

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

@danielhanchen
danielhanchen merged commit dd56fb3 into unslothai:main Oct 14, 2026
danielhanchen added a commit that referenced this pull request Oct 14, 2026
…th since the last raise (#13752)

* Studio frontend: raise the startup bundle budget by the measured growth since the last raise

* Bundle budget: include #12821 and #13630, which merged while this was open
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