From 044eac0cf93ac68650656bbccf884c378532c86f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 4 Nov 2025 12:44:34 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix:=20use=20correct=20reasoning?= =?UTF-8?q?=20parameter=20format=20for=20GitHub=20Copilot=20GPT-5=20models?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: GeorgeDong32 <98630204+GeorgeDong32@users.noreply.github.com> --- .../src/aiCore/legacy/clients/openai/OpenAIApiClient.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/renderer/src/aiCore/legacy/clients/openai/OpenAIApiClient.ts b/src/renderer/src/aiCore/legacy/clients/openai/OpenAIApiClient.ts index 8ff25e356d..ac3b2fe96d 100644 --- a/src/renderer/src/aiCore/legacy/clients/openai/OpenAIApiClient.ts +++ b/src/renderer/src/aiCore/legacy/clients/openai/OpenAIApiClient.ts @@ -306,6 +306,13 @@ export class OpenAIAPIClient extends OpenAIBaseClient< // Grok models/Perplexity models/OpenAI models if (isSupportedReasoningEffortModel(model)) { + // For OpenAI models (GPT-5, o1, o3, o4, etc), use the base class implementation + // which returns the correct { reasoning: { effort, summary } } format + if (isSupportedReasoningEffortOpenAIModel(model)) { + return super.getReasoningEffort(assistant, model) + } + + // For non-OpenAI models (Grok, Perplexity, etc), use reasoning_effort parameter // 检查模型是否支持所选选项 const modelType = getThinkModelType(model) const supportedOptions = MODEL_SUPPORTED_REASONING_EFFORT[modelType]