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
{{ message }}
Repository navigation
reasoningToggle() returns {} for @ai-sdk/openai-compatible despite models.dev declaring a toggle (GLM 4.7, GLM 5-turbo) #42793
GLM 4.7 and GLM 5-turbo (zai-coding-plan) declare reasoning_options: [{"type": "toggle"}] on models.dev, but reasoningToggle() in packages/opencode/src/provider/transform.ts only handles @ai-sdk/alibaba and @ai-sdk/cohere. It returns {} for @ai-sdk/openai-compatible. No reasoning variants appear in the /models menu, so thinking can't be disabled for these models.
Aware of #18598 (closed as intentional). That decision predated the metadata-driven variant system (#36624, #36543, #37519), under which models.dev now declares a toggle for these models, but the new code path can't serve it for this transport. Flagging the inconsistency rather than relitigating the old behavior. If the metadata is wrong instead, that'd be good to know too.
Verification
Against the Z.AI coding plan endpoint, glm-4.7, same prompt:
Metadata-gated (only called when models.dev declares a toggle), fix is similar to the MiniMax M3 variants from #38330. Happy to send a PR with test.each coverage if the approach looks right.
Plugins
No response
OpenCode version
1.18.18
Steps to reproduce
Authenticate zai-coding-plan
/models → GLM 4.7
No reasoning variants offered (thinking can't be disabled)
changed the title [-]easoningToggle() returns {} for @ai-sdk/openai-compatible despite models.dev declaring a toggle (GLM 4.7, GLM 5-turbo)[/-][+]reasoningToggle() returns {} for @ai-sdk/openai-compatible despite models.dev declaring a toggle (GLM 4.7, GLM 5-turbo)[/+]on Aug 15, 2026
Qwen3.x reasoning models don't show thinking level switcher despite supporting thinking_budget #33303 is the legacy id.includes("qwen") blanket exclusion, but models.dev now declares toggle + budget_tokens for qwen3.x. On a custom OpenAI-compatible provider (their DashScope setup), that toggle funnels into the same reasoningToggle() gap — the openai-compatible case suggested above would likely cover those users too. Direct @ai-sdk/alibaba users already get enableThinking variants.
I can take this. I will first add focused reasoningVariants coverage for models.dev-gated toggles, then keep the implementation scoped to the @ai-sdk/openai-compatible provider options.
Thanks for the report! OpenCode 2.0 is now out and development is focused on V2, so we're closing issues filed against OpenCode 1. Please upgrade (opencode upgrade --major, details: https://anoma.ly/notes/opencode-2-0), and if this is still relevant on 2.0, reopen this issue or open a new one with your 2.0 version.
FWIW: After upgrading from 1.19 to 2.0, when using my MiMo-V2.6-Flash token plan, it is no longer allowing /variants or /thinking or /effort switching!?
Activity
[-]easoningToggle() returns {} for @ai-sdk/openai-compatible despite models.dev declaring a toggle (GLM 4.7, GLM 5-turbo)[/-][+]reasoningToggle() returns {} for @ai-sdk/openai-compatible despite models.dev declaring a toggle (GLM 4.7, GLM 5-turbo)[/+]github-actions commentedon Aug 15, 2026
This issue might be a duplicate of or related to existing issues. Please check:
transform.ts), same provider type (@ai-sdk/openai-compatible), GLM model reasoning variant bug — though that one is about wrong variant names (maxvsxhigh) rather than missing toggle supportreasoningToggle()/variants()— same general root cause patternroblennon commentedon Aug 15, 2026
Neither is a duplicate, but #33303 shares a root cause:
GLM-5.2 on OpenAI-compatible providers: TUI variant switcher shows max (invalid reasoning_effort) instead of xhigh #34278 is a different defect — wrong variant names (max vs xhigh) for GLM-5.2 on spec-compliant OpenAI-compatible gateways. Here the endpoint is Z.AI's native API, where
maxis a validreasoning_effort, and the gap is the missing toggle for 4.7/5-turbo.Qwen3.x reasoning models don't show thinking level switcher despite supporting thinking_budget #33303 is the legacy
id.includes("qwen")blanket exclusion, but models.dev now declarestoggle + budget_tokensfor qwen3.x. On a custom OpenAI-compatible provider (their DashScope setup), that toggle funnels into the samereasoningToggle()gap — the openai-compatible case suggested above would likely cover those users too. Direct@ai-sdk/alibabausers already getenableThinkingvariants.fancive commentedon Aug 22, 2026
I can take this. I will first add focused
reasoningVariantscoverage for models.dev-gated toggles, then keep the implementation scoped to the@ai-sdk/openai-compatibleprovider options.fix(models): give toggle-kind models a thinking control in the CLI
thdxr commentedon Oct 11, 2026
Thanks for the report! OpenCode 2.0 is now out and development is focused on V2, so we're closing issues filed against OpenCode 1. Please upgrade (
opencode upgrade --major, details: https://anoma.ly/notes/opencode-2-0), and if this is still relevant on 2.0, reopen this issue or open a new one with your 2.0 version.— from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊
DXXS commentedon Oct 23, 2026
FWIW: After upgrading from 1.19 to 2.0, when using my MiMo-V2.6-Flash token plan, it is no longer allowing /variants or /thinking or /effort switching!?