feat(ai-gateway): derive BYOK variants from models.dev - #4867
Conversation
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Executive SummaryIncremental review of the follow-up change that adds AI SDK provider resolution and Anthropic verbosity mapping to Files Reviewed (2 files)
Previous Review Summaries (2 snapshots, latest commit 3f7d12a)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 3f7d12a)Status: No Issues Found | Recommendation: Merge Executive SummaryIncremental review of the two-file follow-up fix (returning Files Reviewed (2 files)
Previous review (commit 6690698)Status: No Issues Found | Recommendation: Merge Executive SummaryReviewed the direct BYOK variant-derivation changes (models.dev reasoning-option parsing, synced-variant retention, and heuristic-fallback preservation) across 7 files and found no high-confidence bugs, security issues, or breaking changes in the modified lines; the new/updated tests accurately reflect the implemented logic. Files Reviewed (7 files)
Reviewed by claude-sonnet-5 · Input: 22 · Output: 6.8K · Cached: 474.1K Review guidance: REVIEW.md from base branch |
Summary
reasoning_optionstoggleandeffortcontrols, reusing the shared binaryinstant/thinkingvariants for toggle-only modelsDirectByokModeland carry synced variants onto overlapping recommended model entriesREASONING_VARIANTS_NONE_LOW_MEDIUM_HIGHconstantExamples
zai-coding/glm-5.2exposes the catalog-providedhighandmaxefforts:{ "high": { "reasoning": { "enabled": true, "effort": "high" } }, "max": { "reasoning": { "enabled": true, "effort": "max" } } }opencode-go/minimax-m3uses the Anthropic SDK and a catalogtoggle, so its enabled variant also gets matching verbosity:{ "instant": { "reasoning": { "enabled": false, "effort": "none" } }, "thinking": { "reasoning": { "enabled": true, "effort": "high" }, "verbosity": "high" } }opencode-go/qwen3.7-plusincludes unsupportedbudget_tokens, so it falls back to the Qwen binary variants and still receives Anthropic verbosity:{ "instant": { "reasoning": { "enabled": false, "effort": "none" } }, "thinking": { "reasoning": { "enabled": true, "effort": "high" }, "verbosity": "high" } }The disabled variants omit verbosity because
noneis not a validVerbositySchemavalue.Verification
pnpm --filter web test -- --runInBand src/lib/ai-gateway/providers/direct-byok/sync-direct-byok.test.ts src/lib/ai-gateway/providers/direct-byok/index.test.ts(11 tests passed)pnpm --filter web typecheckoxlinton all changed filesgit diff --check