From c6cc1baae1ab3906afea2cbd2ee1b24d5d7b420a Mon Sep 17 00:00:00 2001 From: Phantom <59059173+EurFelux@users.noreply.github.com> Date: Tue, 5 Aug 2025 22:49:37 +0800 Subject: [PATCH] fix(models): some qwen3 models cannot disable thinking (#8854) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(models): 修正qwen3模型thinking系列的支持判断 修复qwen3模型中thinking系列不应支持控制思考的逻辑错误 * Revert "fix(models): 修正qwen3模型thinking系列的支持判断" This reverts commit 189d878dc346b050f87c524c44e911ab1dd8f49b. * feat(OpenAIApiClient): 添加对Qwen3235BA22B模型的支持 处理Qwen3235BA22B模型的特殊逻辑,当检测到该模型时禁用enable_thinking --- src/renderer/src/aiCore/clients/openai/OpenAIApiClient.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/renderer/src/aiCore/clients/openai/OpenAIApiClient.ts b/src/renderer/src/aiCore/clients/openai/OpenAIApiClient.ts index 85fc6cb717..e39d3834bd 100644 --- a/src/renderer/src/aiCore/clients/openai/OpenAIApiClient.ts +++ b/src/renderer/src/aiCore/clients/openai/OpenAIApiClient.ts @@ -7,6 +7,7 @@ import { isDoubaoThinkingAutoModel, isGrokReasoningModel, isNotSupportSystemMessageModel, + isQwen3235BA22BThinkingModel, isQwenMTModel, isQwenReasoningModel, isReasoningModel, @@ -145,6 +146,9 @@ export class OpenAIAPIClient extends OpenAIBaseClient< return { reasoning: { enabled: false, exclude: true } } } if (isSupportedThinkingTokenQwenModel(model) || isSupportedThinkingTokenHunyuanModel(model)) { + if (isQwen3235BA22BThinkingModel(model)) { + return {} + } return { enable_thinking: false } } @@ -192,7 +196,7 @@ export class OpenAIAPIClient extends OpenAIBaseClient< // Qwen models if (isSupportedThinkingTokenQwenModel(model)) { const thinkConfig = { - enable_thinking: true, + enable_thinking: isQwen3235BA22BThinkingModel(model) ? undefined : true, thinking_budget: budgetTokens } if (this.provider.id === 'dashscope') {