Repository navigation
test(modelregistry): clear ZERO_DISABLE_MODELS_FETCH in the models.dev tests - #1169
Merged
Merged
Conversation
…v tests The variable turns off both the models.dev fetch and the cached overlay, and four tests in modelsdev_test.go inherited it from the shell. With it set, TestRefreshModelsDevCacheRejectsBadBodyWithoutClobbering and TestDefaultModelEntriesAppliesFreshCache fail, and TestCachedModelsDevProvidersIgnoresStaleCache and TestCachedModelsDevProvidersRequiresOptIn pass without reaching the check they are named for: the nil they expect comes from the variable. Clear it in each of them, as the two sibling refresh tests already do.
Contributor
Zero automated PR reviewVerdict: No blockers found Blockers
Validation
ScopeHead: This deterministic review checks validation status and basic diff hygiene. A human reviewer still owns product judgment and design quality. |
kevincodex1
approved these changes
Oct 21, 2026
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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 changed
Four tests in
internal/modelregistry/modelsdev_test.gonow clearZERO_DISABLE_MODELS_FETCHwitht.Setenv, the wayTestRefreshModelsDevCacheFetchesAndCachesandTestRefreshModelsDevCacheRejectsOversizedResponsealready do:TestRefreshModelsDevCacheRejectsBadBodyWithoutClobberingTestDefaultModelEntriesAppliesFreshCacheTestCachedModelsDevProvidersIgnoresStaleCacheTestCachedModelsDevProvidersRequiresOptInThe change is test-only.
Why
ZERO_DISABLE_MODELS_FETCHturns off bothRefreshModelsDevCacheand the cached overlay incachedModelsDevProviders, and these four tests read it from whatever shell runs them. I hit this running the whole suite with the variable exported. Onmain:The other two still pass, but only because the
nilthey expect comes from the variable, not from the check each one is named for. With the variable set onmain, deleting the staleness check (|| time.Since(info.ModTime()) > modelsDevMaxAge) or the opt-in check (!modelsDevEnabled.Load() ||) fromcachedModelsDevProvidersleaves both tests green.Verification
On Windows, with
ZERO_DISABLE_MODELS_FETCH=1exported:main: two of the four tests fail as above, and both deletions above go unnoticed.TestCachedModelsDevProvidersIgnoresStaleCache("stale cache must be ignored"), and deleting the opt-in check failsTestCachedModelsDevProvidersRequiresOptIn("overlay must be opt-in"). Skipping the body validation inRefreshModelsDevCache, or not applying the overlay inDefaultModelEntries, fails the other two.With the variable unset, all four pass and catch the same four deletions on both
mainand this branch.go vet ./...for windows, linux and darwin,gofmtandgit diff --checkare clean.go test ./...passes with the variable unset, and again with it exported for the whole run.internal/modelregistryalso passes under-race.go run ./cmd/zero-release buildandsmokepass, and the pinnedgolangci-lintrun overinternal/modelregistryreports nothing.govulncheck ./...reports only GO-2026-6809, the Go 1.26.9crypto/x509advisorymainhas too, which fix: bump Go to 1.26.10 for GO-2026-6809 #1168 fixes.Summary by CodeRabbit