Repository navigation
Studio: don't let a malformed HF token empty the model picker's Recommended list - #7266
Merged
Imagineer99 merged 1 commit intoJul 20, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates the HubModelPicker component to import and use the hfApiToken helper function for sanitizing the Hugging Face access token, aligning its behavior with the Hub page. There are no review comments, so no feedback is provided.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Member
Imagineer99
approved these changes
Jul 20, 2026
danielhanchen
added a commit
to Sneakr/unsloth
that referenced
this pull request
Jul 21, 2026
Resolves the pickers.tsx import conflict from unslothai#7266 (malformed HF token must not empty the Recommended list). The PR consolidated the picker imports onto the @/features/hub barrel, so the resolution keeps that structure and adds main's new hfApiToken there (also re-exported from the hub barrel) rather than reintroducing the deep per-module import paths. The accessToken = hfApiToken( hfToken) fix from unslothai#7266 merges in unchanged.
This was referenced Jul 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


The "Select model" picker's Recommended list calls Hugging Face's
listModelsfrom the browser with the saved token. A malformed token (anything not starting withhf_) makes@huggingface/hubthrow before it even sends a request, and the picker renders that failure as "No models found". The Hub page already runs the token throughhfApiToken()first, so it stays populated; the picker passed the raw token, so only the picker broke.Fix
Route the picker's
accessTokenthroughhfApiToken()too, matching the Hub page. A malformed token now falls back to anonymous browsing, so the public Unsloth listing still shows.The gap dates to #6364/#6605, when the picker adopted the shared search stack but the
hfApiToken()sanitizer was wired only into the Hub page. Not a regression from #7261.Verification
tsc -band eslint on the changed file pass. A valid or even expiredhf_token was never affected, since HF serves the public listing anonymously either way; only a non-hf_token hit this.