From f7d6daedff23a52101870f085b7f925581bf916a Mon Sep 17 00:00:00 2001 From: Hannes Rudolph Date: Thu, 20 Nov 2025 09:38:33 -0700 Subject: [PATCH] Fix OpenAI Native parallel tool calls for native protocol (#9433) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes an issue where using the OpenAI Native provider together with Native Tool Calling could cause OpenAI’s Responses API to fail with errors like: --- src/api/providers/openai-native.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/api/providers/openai-native.ts b/src/api/providers/openai-native.ts index 6926e4d624..74ba621c43 100644 --- a/src/api/providers/openai-native.ts +++ b/src/api/providers/openai-native.ts @@ -244,6 +244,7 @@ export class OpenAiNativeHandler extends BaseProvider implements SingleCompletio strict?: boolean }> tool_choice?: any + parallel_tool_calls?: boolean } // Validate requested tier against model support; if not supported, omit. @@ -302,6 +303,12 @@ export class OpenAiNativeHandler extends BaseProvider implements SingleCompletio ...(metadata?.tool_choice && { tool_choice: metadata.tool_choice }), } + // For native tool protocol, explicitly disable parallel tool calls. + // For XML or when protocol is unset, omit the field entirely so the API default applies. + if (metadata?.toolProtocol === "native") { + body.parallel_tool_calls = false + } + // Include text.verbosity only when the model explicitly supports it if (model.info.supportsVerbosity === true) { body.text = { verbosity: (verbosity || "medium") as VerbosityLevel }