You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Independently validated this fix on current dev. Walking through the empirical loop in case it helps move the review forward:
Repro on unpatched dev: Translated the PR's regression test to current dev's test helpers (the local set(...) / getSmallModel(...) rather than the older Env.set(...) / Provider.getSmallModel(...) shape this PR uses) and ran it without any source change — test fails as expected. getSmallModel(ProviderID.anthropic) returns a populated claude-haiku-4.5 model object instead of undefined when small_model: "" is set, exactly matching the symptom in #4579.
With the 2-line fix applied: The new test passes. The two existing getSmallModel tests still pass (returns appropriate small model, respects config small_model override). One unrelated test (plugin config enabled and disabled providers are honored) times out on dev with or without this patch — it's a pre-existing flake, not caused by this PR.
Heads-up for whoever takes the merge: This PR's test uses Env.set(...) and Provider.getSmallModel(...), but packages/opencode/test/provider/provider.test.ts on current dev defines local helpers (set at line 19, getSmallModel at line 50) and has dropped those direct call sites. Trivial rename on rebase, just want to flag it so CI doesn't trip.
The fix is minimal, the test is targeted, and it directly addresses what the original reporters asked for. Hope the validation is useful.
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
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.
Issue for this PR
Closes #4579
Type of change
What does this PR do?
small_model: ""was still falling back to the default small model, which could trigger unexpected Haiku requests.This change treats an explicit empty
small_modelas disabled and adds a regression test for that case.How did you verify your code works?
bun test test/provider/provider.test.ts -t "getSmallModel"bun typecheckbun turbo typecheckScreenshots / recordings
N/A
Checklist