Skip to content

Qwen3.x reasoning models don't show thinking level switcher despite supporting thinking_budget #33303

Closed as not planned

Description

@dszw312492869

Description

Qwen3.7 Max (and other Qwen3.x reasoning models like Qwen3.6 Plus, Qwen3.5 Plus) support adjustable thinking depth via DashScope's thinking_budget parameter, but OpenCode's TUI never shows the thinking level switcher for any Qwen model.

Root cause — in packages/opencode/src/provider/transform.ts, the variants() function has a hardcoded exclusion at line ~702-714:

if (
    id.includes("deepseek-chat") ||
    id.includes("deepseek-reasoner") ||
    id.includes("deepseek-r1") ||
    id.includes("deepseek-v3") ||
    id.includes("minimax") ||
    (id.includes("glm") && !glm52) ||
    id.includes("kimi") ||
    id.includes("k2p") ||
    id.includes("qwen") ||        // ← blocks ALL Qwen models
    id.includes("big-pickle")
  )
    return {}

The id.includes("qwen") check is a blanket exclusion that prevents all Qwen models from exposing thinking level variants, even though:

  1. models.dev correctly marks qwen3.7-max with reasoning: true ✅
  2. capabilities.reasoning is correctly set to true ✅
  3. DashScope's OpenAI-compatible API supports enable_thinking: true + thinking_budget for fine-grained control

The model passes the first gate (capabilities.reasoning === true) but is immediately blocked by the hardcoded string match, returning empty variants {} to the TUI.

Expected behavior

Qwen3.x reasoning models (3.5+, 3.6, 3.7) should expose thinking level variants similar to Google's thinkingBudget approach, e.g.:

if (id.includes("qwen3.7") || id.includes("qwen3.6") || id.includes("qwen3.5")) {
  return {
    low:  { enable_thinking: true, thinking_budget: 4096 },
    high: { enable_thinking: true, thinking_budget: 16000 },
    max:  { enable_thinking: true, thinking_budget: 32768 },
  }
}

Plugins

superpowers, oh-my-openagent

OpenCode version

1.17.9

Steps to reproduce

  1. Configure any Alibaba/DashScope provider (e.g. alibaba-token-plan-cn) in OpenCode
  2. Select qwen3.7-max as the model
  3. Observe that no thinking level switcher appears in the TUI prompt area
  4. Compare with a model like glm-5.2 or claude-opus-4.6 which correctly shows the thinking level toggle

Screenshot and/or share link

N/A

Operating System

macOS 15.5

Terminal

iTerm2

Activity

  1. vugoqk commented on Jun 22, 2026

    @vugoqk

    我也遇到过这个问题,可以根据百炼官方提供的文档自定义一个Provider,然后自己设置variants

    "provider": {
        "bailian-payg": {
          "models": {
            "qwen3.7-max": {
              "name": "Qwen3.7 Max",
              "reasoning": true,
              "variants": {
                "low": {
                  "thinking": {
                    "budgetTokens": 4096,
                    "type": "enabled"
                  }
                },
                "medium": {
                  "thinking": {
                    "budgetTokens": 8192,
                    "type": "enabled"
                  }
                },
                "high": {
                  "thinking": {
                    "budgetTokens": 16384,
                    "type": "enabled"
                  }
                },
                "max": {
                  "thinking": {
                    "budgetTokens": 32768,
                    "type": "enabled"
                  }
                }
              }
            }
          },
          "name": "Alibaba Cloud Model Studio",
          "npm": "@ai-sdk/anthropic",
          "options": {
            "apiKey": "your-apiKey",
            "baseURL": "https://dashscope.aliyuncs.com/apps/anthropic/v1",
            "setCacheKey": true
          }
        },

    当然这只是一个临时解决方案,希望opencode官方能够尽快适配:)

  2. yapnel commented on Jun 22, 2026

    @yapnel

    我也遇到过这个问题,可以根据百炼官方提供的文档自定义一个Provider,然后自己设置variants

    "provider": {
    "bailian-payg": {
    "models": {
    "qwen3.7-max": {
    "name": "Qwen3.7 Max",
    "reasoning": true,
    "variants": {
    "low": {
    "thinking": {
    "budgetTokens": 4096,
    "type": "enabled"
    }
    },
    "medium": {
    "thinking": {
    "budgetTokens": 8192,
    "type": "enabled"
    }
    },
    "high": {
    "thinking": {
    "budgetTokens": 16384,
    "type": "enabled"
    }
    },
    "max": {
    "thinking": {
    "budgetTokens": 32768,
    "type": "enabled"
    }
    }
    }
    }
    },
    "name": "Alibaba Cloud Model Studio",
    "npm": "@ai-sdk/anthropic",
    "options": {
    "apiKey": "your-apiKey",
    "baseURL": "https://dashscope.aliyuncs.com/apps/anthropic/v1",
    "setCacheKey": true
    }
    },
    当然这只是一个临时解决方案,希望opencode官方能够尽快适配:)

    Kindly please show how you have configured this? I am using a Chinese to English translator for your message. Thank you

  3. vugoqk commented on Jun 22, 2026

    @vugoqk

    我也遇到过这个问题,可以根据百炼官方提供的文档自定义一个Provider,然后自己设置variants
    "provider": {
    "bailian-payg": {
    "models": {
    "qwen3.7-max": {
    "name": "Qwen3.7 Max",
    "reasoning": true,
    "variants": {
    "low": {
    "thinking": {
    "budgetTokens": 4096,
    "type": "enabled"
    }
    },
    "medium": {
    "thinking": {
    "budgetTokens": 8192,
    "type": "enabled"
    }
    },
    "high": {
    "thinking": {
    "budgetTokens": 16384,
    "type": "enabled"
    }
    },
    "max": {
    "thinking": {
    "budgetTokens": 32768,
    "type": "enabled"
    }
    }
    }
    }
    },
    "name": "Alibaba Cloud Model Studio",
    "npm": "@ai-sdk/anthropic",
    "options": {
    "apiKey": "your-apiKey",
    "baseURL": "https://dashscope.aliyuncs.com/apps/anthropic/v1",
    "setCacheKey": true
    }
    },
    当然这只是一个临时解决方案,希望opencode官方能够尽快适配:)

    Kindly please show how you have configured this? I am using a Chinese to English translator for your message. Thank you

    Sure, here's the full configuration. You just need to add it in your OpenCode config file.
    Config file locations:

    OS Path
    macOS / Linux ~/.config/opencode/opencode.json
    Windows %USERPROFILE%\.config\opencode\opencode.json
    {
      "$schema": "https://opencode.ai/config.json",
      // ... your other configs
      "provider": {
        "bailian-payg": {
          "models": {
            "qwen3.7-max": {
              "name": "Qwen3.7 Max",
              "reasoning": true,
              "variants": {
                "low": { "thinking": { "budgetTokens": 4096, "type": "enabled" } },
                "medium": { "thinking": { "budgetTokens": 8192, "type": "enabled" } },
                "high": { "thinking": { "budgetTokens": 16384, "type": "enabled" } },
                "max": { "thinking": { "budgetTokens": 32768, "type": "enabled" } }
              }
            }
          },
          "name": "Alibaba Cloud Model Studio",
          "npm": "@ai-sdk/anthropic",
          "options": {
            "apiKey": "your-apiKey",
            "baseURL": "https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/apps/anthropic/v1",
            "setCacheKey": true
          }
        }
      }
    }

    Don't forget to replace "your-apiKey" and "baseURL" with your actual API key and baseURL before saving. The baseURL and API format might differ in different regions.
    For more details, see the OpenCode Config Docs.

  4. github-actions commented on Aug 22, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

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