fix(provider): reasoning-budget, gemini-3, interleaved-merge & catalog-refresh correctness#120
Merged
Aayam Bansal (aayambansal) merged 1 commit intoJul 7, 2026
Conversation
…g-refresh correctness Four provider/transform correctness fixes from the backend audit: - max reasoning variant no longer starves text to 1 token. On a 32k-output Claude, the max thinking budget of cap-1 (31,999) left maxOutputTokens returning a single text token; keep it proportional (~3/4 of cap). Large caps still clamp at 31,999. (#17) - Gemini-3 effort variants are nested under thinkingConfig. @ai-sdk/google only reads providerOptions.google.thinkingConfig.*, so the old top-level keys were dropped and effort selection was silently ignored (always high). (#24) - Config-model merge falls back to the catalog model's interleaved shape like every other capability, so overriding one field (e.g. cost) no longer drops the interleaved-reasoning relocation. (#29) - ModelsDev.refresh() now invalidates provider state so a long-running session picks up the hourly-refreshed catalog instead of the first snapshot. (#25)
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Four provider/transform correctness fixes from the audit:
maxreasoning no longer starves text to 1 token. On a 32k-output Claude, themaxthinking budget ofcap-1(31,999) mademaxOutputTokensreturn a single text token (empirically confirmed). Keep the budget proportional (floor(cap*3/4)); large-cap models still clamp at 31,999.thinkingConfig.@ai-sdk/googleonly readsproviderOptions.google.thinkingConfig.*, so the old top-level keys were dropped and effort was silently ignored (alwayshigh).interleavedshape like every other capability, so overriding one field (e.g. cost) no longer drops the interleaved-reasoning relocation innormalizeMessages.ModelsDev.refresh()now invalidates provider state (dynamic import to avoid a cycle), so a long-running session picks up the hourly catalog refresh instead of the first snapshot.Tests
New coverage in
transform-reasoning.test.ts(max budget leaves ≥4k text on a 32k model; large caps clamp at 31,999; gemini-3 nests underthinkingConfig). Updated the existing gemini variant test to the corrected shape. All 196 provider tests green.