Skip to content

fix(cmd/flynn): honour --data-dir in models check; resolve providers.json for child models - #637

Merged
ion-alpha-dev merged 3 commits into
mainfrom
fix/cmd-flynn-models-check-data-dir
Nov 1, 2026
Merged

ion-alpha-dev merged 3 commits into
mainfrom
fix/cmd-flynn-models-check-data-dir

Conversation

@ion-alpha-dev

Copy link
Copy Markdown
Collaborator

What

Three small fixes in cmd/flynn. flynn models check now reads the data directory it is given, a delegated child resolves a server named in providers.json the same way the root model does, and a listing test uses a fake server model id that no catalog entry can use.

Why

models check read the platform default data directory, so a runtime that models install had placed under --data-dir was reported as not installed. models install and models run already 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.

TestModelsCheckReadsTheDataDirectoryItIsGiven points the platform default directory at an empty place, installs a runtime under --data-dir, and expects models check to report it. It fails when the call goes back to the platform default, which was checked by reverting the call locally.

TestChildModelResolverReadsTheProvidersFile resolves box:<model> through the child resolver with and without a providers.json naming box, 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.

TestModelsCheckReadsTheDataDirectoryItIsGiven installs a stand-in runtime from a local server, as the existing check tests do. It skips on a platform with no pinned runtime build.

…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

codecov Bot commented Oct 31, 2026

Copy link
Copy Markdown

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]>
@ion-alpha-dev
ion-alpha-dev merged commit e8e9622 into main Nov 1, 2026
32 checks passed
@ion-alpha-dev
ion-alpha-dev deleted the fix/cmd-flynn-models-check-data-dir branch November 1, 2026 07:07
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 1, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant