Repository navigation
fix(cmd/flynn): honour --data-dir in models check; resolve providers.json for child models - #637
Merged
Merged
Conversation
…json for child models `flynn models check` called runRuntimeCheck, which reads the platform default data directory, so a runtime installed under --data-dir was reported as missing. It now calls runRuntimeCheckAt with the directory the other models subcommands use. A delegated child's hosted model now resolves through modelSource, the same source as the root model, so a server named in providers.json resolves for a child the way it does at the top of a run. The listing test faked a server model whose id is a real catalog name, so adding that model to the catalog would fail the test. It now uses an id no catalog entry uses. Signed-off-by: Ion Alpha <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
The case map in TestIdentityPolicyRejectsForeignSigners was not gofmt aligned, so the format gate failed. The change is whitespace only. Signed-off-by: Ion Alpha <MASKED_EMAIL_2f4470978a>
The earlier gofmt-only commit on this file is outside this change and undoes gofumpt alignment that CI's lint enforces. Putting main's content back leaves the branch diff limited to the cmd/flynn fixes. Signed-off-by: Ion Alpha <[email protected]>
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
What
Three small fixes in
cmd/flynn.flynn models checknow reads the data directory it is given, a delegated child resolves a server named inproviders.jsonthe same way the root model does, and a listing test uses a fake server model id that no catalog entry can use.Why
models checkread the platform default data directory, so a runtime thatmodels installhad placed under--data-dirwas reported as not installed.models installandmodels runalready honour the flag.A delegated child resolved its hosted model through the credential chain alone, so an archetype that pinned
box:<model>failed with "unknown provider" while the same spec resolved at the top of a run. The child now uses the same source as the root model.The listing test faked an Ollama model with the id
gpt-oss:20b. Any catalog entry with that id would have made the test fail, so the test constrained which models the catalog may ship.How to verify
Run
go test ./cmd/flynn/ -run 'TestModelsCheckReadsTheDataDirectoryItIsGiven|TestChildModelResolverReadsTheProvidersFile|TestModelsOmitsServerModelsWhenFilteredOrAPIOnly' -v.TestModelsCheckReadsTheDataDirectoryItIsGivenpoints the platform default directory at an empty place, installs a runtime under--data-dir, and expectsmodels checkto report it. It fails when the call goes back to the platform default, which was checked by reverting the call locally.TestChildModelResolverReadsTheProvidersFileresolvesbox:<model>through the child resolver with and without aproviders.jsonnamingbox, and with a malformed file. It fails when the hosted branch goes back to the credential chain alone, which was checked the same way.Notes for reviewers
No GitHub issue is linked. The three changes are independent and are combined here at the maintainer's request, so any one can be split out if preferred.
TestModelsCheckReadsTheDataDirectoryItIsGiveninstalls a stand-in runtime from a local server, as the existing check tests do. It skips on a platform with no pinned runtime build.