diff --git a/src/core/api/providers/openai.ts b/src/core/api/providers/openai.ts index ec1b46e1..9a6ae696 100644 --- a/src/core/api/providers/openai.ts +++ b/src/core/api/providers/openai.ts @@ -103,14 +103,8 @@ export class OpenAiHandler implements ApiHandler { reasoningEffort = (this.options.reasoningEffort as ChatCompletionReasoningEffort) || "medium" } - const isOfficialOpenAi = - !this.options.openAiBaseUrl || - this.options.openAiBaseUrl.toLowerCase().includes("api.openai.com") || - this.options.openAiBaseUrl.toLowerCase().includes("azure.com") || - this.options.openAiBaseUrl.toLowerCase().includes("azure.us") - - const effectiveTools = isOfficialOpenAi ? tools : undefined - + // Tools are passed through directly - the system prompt variant selection + // determines whether to use native tools or XML-based tools const stream = await client.chat.completions.create({ model: modelId, messages: openAiMessages, @@ -119,7 +113,7 @@ export class OpenAiHandler implements ApiHandler { reasoning_effort: reasoningEffort, stream: true, stream_options: { include_usage: true }, - ...getOpenAIToolParams(effectiveTools), + ...getOpenAIToolParams(tools), }) const toolCallProcessor = new ToolCallProcessor() diff --git a/src/utils/model-utils.ts b/src/utils/model-utils.ts index 99307aeb..96926a11 100644 --- a/src/utils/model-utils.ts +++ b/src/utils/model-utils.ts @@ -11,7 +11,8 @@ export function isNextGenModelProvider(providerInfo: ApiProviderInfo): boolean { "gemini", "vertex", "openrouter", - "openai", + // Note: "openai" is excluded to use XML-based tool parsing for better compatibility + // with OpenAI-compatible providers. Use "openai-native" for native tool calling with official OpenAI. "minimax", "openai-native", "baseten",