Skip to content

models: an empty models--* husk no longer hides a plain model store - #143

Merged
T-Crypt merged 2 commits into
mainfrom
T-Crypt/models-scan-hf-husk
Oct 22, 2026
Merged

T-Crypt merged 2 commits into
mainfrom
T-Crypt/models-scan-hf-husk

Conversation

@T-Crypt

@T-Crypt T-Crypt commented Oct 22, 2026

Copy link
Copy Markdown
Owner

Fixes #138, reported by @azrael-229.

Problem

sourceOf() read a model root as a HuggingFace cache as soon as one directory was named models--*. A Windows LM Studio store with 43 models and one empty models--... husk, left by an abandoned download, listed 0 models.

Change

A root is an HF cache only when a models--* directory holds snapshots/, which is what scanHFCache reads. A store whose only models--* entries are empty is scanned as a plain directory. The Ollama check and both scans are unchanged.

Proof

  • TestScanHFHusk (table, through Scan): a husk beside a plain store, a real cache, and a real cache with a husk beside it.
  • Without the fix, the first case gives scan = (no models), the reported symptom. With it, all three pass.
  • build, gofmt, vet, go test ./..., Windows build and vet, golangci-lint (0 issues).

Out of scope: one root that mixes an HF cache with plain model folders still scans as an HF cache, as before.

A root was read as a HuggingFace cache as soon as one directory was named
models--*, so an abandoned, empty download in an LM Studio store made all
43 models beside it disappear. A root is an HF cache only when a models--*
directory holds snapshots/, which is what the HF scan reads.
@T-Crypt
T-Crypt merged commit 94171b9 into main Oct 22, 2026
2 checks passed
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.

models scan: one models--* husk dir makes the whole store read as an empty HF cache

1 participant