Skip to content

fix(opencode): remove model ID blocklist from reasoning variants#23335

Open
elonazoulay wants to merge 1 commit intoanomalyco:devfrom
elonazoulay:fix/opencode-openai-compatible-reasoning-variants
Open

fix(opencode): remove model ID blocklist from reasoning variants#23335
elonazoulay wants to merge 1 commit intoanomalyco:devfrom
elonazoulay:fix/opencode-openai-compatible-reasoning-variants

Conversation

@elonazoulay
Copy link
Copy Markdown

@elonazoulay elonazoulay commented Apr 18, 2026

Issue for this PR

Closes #23334

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Removes the hardcoded model ID blocklist from variants() in transform.ts. Instead of excluding models by name (deepseek, glm, minimax, mistral, kimi, qwen, etc.), reasoning effort variants are now gated solely by capabilities.reasoning from models.dev.

Verified that z-ai (GLM-5.1), DeepSeek, and Fireworks all support reasoning_effort through their openai-compatible APIs.

How did you verify your code works?

From packages/opencode:

  • bun test test/provider/transform.test.ts
  • bun typecheck

Added focused coverage for:

  • deepseek with reasoning: true on @ai-sdk/openai-compatible returning low / medium / high
  • deepseek with reasoning: false returning {}
  • glm with reasoning: true on @ai-sdk/openai-compatible returning low / medium / high
  • mistral on @ai-sdk/mistral returning {} (handled by provider switch)

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@rekram1-node
Copy link
Copy Markdown
Collaborator

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

@elonazoulay elonazoulay changed the title fix(opencode): restore reasoning variants for openai-compatible deepseek glm and minimax fix(opencode): remove model ID blocklist from reasoning variants Apr 19, 2026
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.
@elonazoulay elonazoulay force-pushed the fix/opencode-openai-compatible-reasoning-variants branch from 3196415 to 603bd25 Compare April 19, 2026 20:00
@elonazoulay
Copy link
Copy Markdown
Author

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

Hey, thanks for taking a look at this pr!
I am testing it locally, could be that it is a recent change, I verified that zai, deepseek and fireworks all support reasoning. And the difference is amazing when using this locally.

opencode is the best!

Either way, lmk if this is good or any changes needed. Much appreciated!

@rekram1-node
Copy link
Copy Markdown
Collaborator

I verified that zai, deepseek and fireworks all support reasoning.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: openai-compatible deepseek/glm/minimax models lost reasoning variants after qwen exclusion

2 participants