Repository navigation
Tag the compat endpoint's Ollama rows with their real source - #9988
Conversation
The chat and training pickers group and label local rows by source, and the frontend branches on "ollama" explicitly — but the legacy scanner in routes/models.py stamped its rows "custom", the legacy LocalModelInfo literal did not even admit "ollama" (so correcting the stamp alone 500'd GET /api/models/local), and the custom-folder merge re-stamped every row from a registered folder, so registering ~/.ollama/models (Studio's own recommended folder) lost the attribution a second way. Admit "ollama" in the legacy literal, stamp the scanner's rows with it, and give the merge the same already-attributed guard _promote_to_custom_source() applies on the hub path. Part of unslothai#9986 (bug 1); the rich-manifest withholding (bug 2) is a deliberate gate and stays untouched pending a maintainer call.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ffc0b20d7d
ℹ️ 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".
Codex review caught that the recipe selector's sourceLabel() had no case for the newly admitted "ollama" value, so corrected rows still read as the generic "Local". Label it "Ollama", matching the hub inventory's localSourceLabel, and pin both the case and the cross-stack parity.
|
@codex review |
|
Codex Review: Didn't find any major issues. Can't wait for the next one! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
What
Bug 1 of #9986, the three stacked breaks in the legacy
GET /api/models/localpath (follow-through on #9237, which fixed the hub-inventory side):_scan_ollama_dirinroutes/models.pystamped its rowssource = "custom", so the frontend's explicit"ollama"branches (chat picker grouping, "Ollama" labels, train-picker exclusions) never fired on this endpoint.LocalModelInfoliteral inmodels/models.pydid not admit"ollama"at all — unlike its hub-schema sibling — so correcting the stamp alone turned the route into a 500 via pydantic ValidationError."custom", so registering~/.ollama/models(which Studio's own recommended-folders onboarding suggests) destroyed the attribution a second way. The hub path's_promote_to_custom_source()already guardshf_cache/ollamarows; the merge now applies the same rule.Plus the matching
"ollama"member on the training API's TS union (the chat union already has it from #9237).Reproduced → fixed
New
tests/test_legacy_ollama_source.py(4 tests): the schema admits the source, the scanner stamps it, and the merge keepshf_cache/ollamaattributions — all 4 fail on unmodified main (literal_error / "custom" stamps) and pass here.Not in this PR
Bug 2 — the rich-manifest withholding that hides essentially every normal
ollama pull(they all carry atemplatelayer) — is a deliberate gate pinned bytest_rich_manifest_is_withheld_from_inventory, with a stated behavior-difference rationale (llama.cpp drops the Modelfile's system/template). I've laid out the options on the issue and will follow up once maintainers pick a direction rather than silently flipping that contract here.Tests
New file 4/4; neighboring route suites (
test_cached_gguf_routes,test_scan_folder_health,test_local_model_format,test_recommended_folders_has_model): 338 pass. Frontendtscclean. Ruff + kwarg formatter applied.