From 46fc2e14fed5631fa6288ffd8919ca2e4d870d89 Mon Sep 17 00:00:00 2001 From: Hannes Rudolph Date: Thu, 13 Nov 2025 07:22:52 -0700 Subject: [PATCH] openai-native: include reasoning.encrypted_content only when reasoningEffort is set; prevent Responses API error on non-reasoning models. types: remove supportsVerbosity from gpt-5-chat-latest to avoid invalid verbosity error. Fixes #9225 --- packages/types/src/providers/openai.ts | 1 - src/api/providers/openai-native.ts | 6 ++++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/types/src/providers/openai.ts b/packages/types/src/providers/openai.ts index a3eed1b57ce..89bc2e63ab4 100644 --- a/packages/types/src/providers/openai.ts +++ b/packages/types/src/providers/openai.ts @@ -16,7 +16,6 @@ export const openAiNativeModels = { outputPrice: 10.0, cacheReadsPrice: 0.13, description: "GPT-5 Chat Latest: Optimized for conversational AI and non-reasoning tasks", - supportsVerbosity: true, }, "gpt-5-2025-08-07": { maxTokens: 128000, diff --git a/src/api/providers/openai-native.ts b/src/api/providers/openai-native.ts index 1cf195a3ba9..49bdf41a047 100644 --- a/src/api/providers/openai-native.ts +++ b/src/api/providers/openai-native.ts @@ -216,7 +216,8 @@ export class OpenAiNativeHandler extends BaseProvider implements SingleCompletio // Unlike Chat Completions, system/developer roles in input have no special semantics here. // The official way to set system behavior is the top-level `instructions` field. instructions: systemPrompt, - include: ["reasoning.encrypted_content"], + // Only include encrypted reasoning content when reasoning effort is set + ...(reasoningEffort ? { include: ["reasoning.encrypted_content"] } : {}), ...(reasoningEffort ? { reasoning: { @@ -1098,7 +1099,8 @@ export class OpenAiNativeHandler extends BaseProvider implements SingleCompletio ], stream: false, // Non-streaming for completePrompt store: false, // Don't store prompt completions - include: ["reasoning.encrypted_content"], + // Only include encrypted reasoning content when reasoning effort is set + ...(reasoningEffort ? { include: ["reasoning.encrypted_content"] } : {}), } // Include service tier if selected and supported