Skip to content
This repository was archived by the owner on May 15, 2026. It is now read-only.

Commit 431f65d

Browse files
committed
fix: default OpenAI Compatible provider to XML protocol for better third-party proxy compatibility
1 parent 78dc344 commit 431f65d

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

packages/types/src/providers/openai.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,10 @@ export const openAiModelInfoSaneDefaults: ModelInfo = {
551551
inputPrice: 0,
552552
outputPrice: 0,
553553
supportsNativeTools: true,
554-
defaultToolProtocol: "native",
554+
// Default to XML for OpenAI Compatible providers since third-party proxies
555+
// have varying levels of support for native tool calling. Users who want
556+
// native tool calling can explicitly enable it in Advanced Settings.
557+
defaultToolProtocol: "xml",
555558
}
556559

557560
// https://learn.microsoft.com/en-us/azure/ai-services/openai/api-version-deprecation

src/utils/__tests__/resolveToolProtocol.spec.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -376,13 +376,15 @@ describe("resolveToolProtocol", () => {
376376
expect(result).toBe(TOOL_PROTOCOL.XML) // Model default wins
377377
})
378378

379-
it("should use native tools for OpenAI compatible provider with default model info", () => {
379+
it("should use XML for OpenAI compatible provider with default model info", () => {
380380
const settings: ProviderSettings = {
381381
apiProvider: "openai",
382382
}
383-
// Using the actual openAiModelInfoSaneDefaults to verify the fix
383+
// OpenAI Compatible defaults to XML protocol since third-party proxies
384+
// have varying levels of support for native tool calling.
385+
// Users who want native can explicitly enable it in Advanced Settings.
384386
const result = resolveToolProtocol(settings, openAiModelInfoSaneDefaults)
385-
expect(result).toBe(TOOL_PROTOCOL.NATIVE) // Should use native tools by default
387+
expect(result).toBe(TOOL_PROTOCOL.XML) // Should use XML by default for better compatibility
386388
})
387389
})
388390
})

0 commit comments

Comments
 (0)