Skip to content

reasoningToggle() returns {} for @ai-sdk/openai-compatible despite models.dev declaring a toggle (GLM 4.7, GLM 5-turbo) #42793

Closed as not planned

Description

@roblennon

Description

Problem

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:

  • thinking: {"type": "disabled"} → reasoning_content empty, correct answer
  • default → 269 chars of reasoning_content, correct answer

The API honors the toggle. Only the menu variants are missing.

Suggested fix

case "@ai-sdk/openai-compatible":
  return {
    none: { thinking: { type: "disabled" } },
    high: { thinking: { type: "enabled" } },
  }

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

  1. Authenticate zai-coding-plan
  2. /models → GLM 4.7
  3. No reasoning variants offered (thinking can't be disabled)

Screenshot and/or share link

No response

Operating System

macOS 15.6.1

Terminal

No response

Activity

  1. 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
  2. github-actions commented on Aug 15, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of or related to existing issues. Please check:

  3. roblennon commented on Aug 15, 2026

    @roblennon
    Author

    Neither is a duplicate, but #33303 shares a root cause:

  4. fancive commented on Aug 22, 2026

    @fancive
    Contributor

    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.

  5. thdxr commented on Oct 11, 2026

    @thdxr
    Member

    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 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊

  6. DXXS commented on Oct 23, 2026

    @DXXS

    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!?

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions