fix: match revision-pinned HF models in doctor's model cache scan - #964
Open
costajohnt wants to merge 1 commit into
Open
costajohnt wants to merge 1 commit into
costajohnt wants to merge 1 commit into
Conversation
findCachedModelInspection split off the filename but kept the trailing #revision fragment when matching against cached blob names, so a revision-pinned Hugging Face model (hf:org/model/file.gguf#<sha>) never matched its cached blob and qmd doctor always reported it missing even though it resolves offline. Split the filename and revision apart and require the blob to contain both when the model URI carries a revision, while leaving unpinned URIs matched by filename alone (unchanged backward-compatible behavior). Fixes tobi#963
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.
Fixes #963
findCachedModelInspectiontookmodel.split("/").pop()as the filename to look for in the model cache. For a revision-pinned URI (hf:org/model/file.gguf#<sha>) that string still carries the#<sha>fragment, while node-llama-cpp writes the blob ashf_org_model_<sha>_file.ggufwith the revision before the filename. The substring check never matched, soqmd doctorreported the model missing even though it resolves offline from that same cache.This splits the last path segment on
#into filename and revision. A blob has to contain the filename, and when the URI carries a revision it also has to contain that revision, so a pinned URI is not satisfied by an unpinned blob or by a blob cached under a different revision. Unpinned URIs keep matching by filename alone. The check stays readdir-based and offline, as in #829.Tests (in
test/cli.test.ts, same shape as the.etagsidecar test): pinned URI matches its revisioned blob (fails on main, passes with the fix); pinned URI is still reported missing when only a different revision is cached; unpinned URI still matches a blob that carries a revision segment. Ranbun test ... test/cli.test.ts -t doctor(15 pass),npx vitest run test/cli.test.ts -t doctor(15 passed),oxlintandtsc --noEmitclean.CHANGELOG entry added under Unreleased / Fixed.