fix: 回退 Grok 从 isOpenAIThinkingEnabled 的自动检测

Grok 推理模型(如 grok-4.20-reasoning)自动进行推理,不需要
thinking/enable_thinking 请求参数。发送这些参数虽大概率被忽略
(OpenAI SDK 透传 unknown keys),但属于不正确行为。

Co-Authored-By: deepseek-v4-pro[1m] <deepseek-ai@claude-code-best.win>
This commit is contained in:
cepvor 2026-05-16 13:52:06 +08:00
parent ed1bea9d1a
commit 13b5ec4447

View File

@ -23,13 +23,11 @@ export function isOpenAIThinkingEnabled(model: string): boolean {
if (isEnvDefinedFalsy(process.env.OPENAI_ENABLE_THINKING)) return false
// Explicit enable
if (isEnvTruthy(process.env.OPENAI_ENABLE_THINKING)) return true
// Auto-detect from model name (DeepSeek, MiMo, and Grok models support thinking mode)
// Auto-detect from model name (DeepSeek and MiMo models support thinking mode).
// Grok is intentionally excluded — Grok reasoning models reason automatically
// and do NOT require thinking/enable_thinking request body parameters.
const modelLower = model.toLowerCase()
return (
modelLower.includes('deepseek') ||
modelLower.includes('mimo') ||
modelLower.includes('grok')
)
return modelLower.includes('deepseek') || modelLower.includes('mimo')
}
/**