mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#5001
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/4315
Author: @XiaoBinGan
Created: 10/27/2026
Status: ❌ Closed
Base:
main← Head:fix/model-folder-case📝 Commits (1)
0e37675Fix #3996: find the model's folder when its name differs in case from the tag📊 Changes
2 files changed (+57 additions, -1 deletions)
View changed files
📝
strata_cli/launch/modelstate.py(+22 -1)📝
tests/terminal/test_tui2_023_plan.py(+35 -0)📄 Description
Problem and result
On a case-sensitive filesystem,
strata launchreports a fully downloaded model as not being on thiscomputer and offers the whole download again.
setup.pywrites the model's folder with the modelname's spelling (
models/IQ3_S) whilecatalog.tag_of()lower-cases the same name (iq3_s), andmodelstate.assess()joined the lower-case tag straight ontomodels/, so the folder was never found.After this change the model's folder is resolved by a case-insensitive match when the exact name is
absent, so the plan, the screens and the confirm dialog count the weights that are already there.
Related discussion: #3996 — the report, with the Omarchy/btrfs reproduction and the exact commands.
Approach
One resolver in
strata_cli/launch/modelstate.py, used by the one place that read the folder this way:strata launchitself (lower case) is still found: the exact path matches first.modelstate.assess()needed it.runner.py's install path already joins the family tag with themodel name in their own spelling (
data_dir / "models" / (fam.get("tag", "") + s.model)), so it isuntouched.
Validation
Passed — the fix on a case-sensitive filesystem, using the module itself (Python 3.12, Linux
container on this host). The script loads
strata_cli/launch/modelstate.pywith its two importedconstants stubbed, builds
models/IQ3_Swith a 4,096-byte shard, and asks the module's own resolver:Passed —
python -m pytest tests/terminal/test_tui2_023_plan.py -q(Python 3.11.16, from a sourcecheckout): 12 passed, including the three new cases in
ModelFolderCase. They assert on theresolver's returned folder name, so they mean something on a case-insensitive filesystem too (NTFS
matches
iq3_stoIQ3_S, which is why the whole-disk byte count alone cannot show the bug there).Passed — no regression in the neighbouring plan tests: with
strata_cli/launch/modelstate.pyreverted,
tests/terminal/test_flow2_022.pyis 3 failed, 24 passed, 3 skipped; with the change itis 3 failed, 24 passed, 3 skipped. The same three (and 22 in
tests/terminal/test_discovery.py,counted the same way before and after) fail on this Windows checkout without the change as well, so
they are environmental, not caused by it.
Failed — none of the four
ModelFolderCasecases.Not run — the real
strata launch --planon a Linux btrfs install, which is what #3996 reported. Theverification above exercises the same resolver and the same byte count with the module loaded directly;
I did not repeat the reporter's whole flow, and I am not claiming I did.
Limits
models/are compared.That is where both writers put the folder.
as before.
_has_reader()already looked atmodels/andModels/; this change does not touch it.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.