fix(opencode): remove model ID blocklist from reasoning variants#23335
fix(opencode): remove model ID blocklist from reasoning variants#23335elonazoulay wants to merge 1 commit intoanomalyco:devfrom
Conversation
2c4b5ae to
3ef0d34
Compare
|
hm there is no restore? They have always been omitted since none of the models support reasoning efforts as far as I know, may have changed for some models |
Use capabilities.reasoning from models.dev as the sole gate for whether a model gets reasoning effort variants, instead of hardcoding model ID exclusions. This allows openai-compatible providers like Fireworks, z-ai and deepseek to correctly send reasoning_effort.
3196415 to
603bd25
Compare
Hey, thanks for taking a look at this pr! opencode is the best! Either way, lmk if this is good or any changes needed. Much appreciated! |
How did u verify this? From what I read on their docs reasoning effort doesnt do anything for zai or deepseek models regardless of if the api allows them |
Issue for this PR
Closes #23334
Type of change
What does this PR do?
Removes the hardcoded model ID blocklist from
variants()intransform.ts. Instead of excluding models by name (deepseek, glm, minimax, mistral, kimi, qwen, etc.), reasoning effort variants are now gated solely bycapabilities.reasoningfrom models.dev.Verified that z-ai (GLM-5.1), DeepSeek, and Fireworks all support
reasoning_effortthrough their openai-compatible APIs.How did you verify your code works?
From
packages/opencode:bun test test/provider/transform.test.tsbun typecheckAdded focused coverage for:
deepseekwithreasoning: trueon@ai-sdk/openai-compatiblereturninglow/medium/highdeepseekwithreasoning: falsereturning{}glmwithreasoning: trueon@ai-sdk/openai-compatiblereturninglow/medium/highmistralon@ai-sdk/mistralreturning{}(handled by provider switch)Checklist