fix: enable native tools by default for OpenAI compatible provider (#10159)

This commit is contained in:
Daniel 2025-12-17 16:02:45 -05:00 committed by GitHub
parent aa3b4ae9cc
commit 2a2411d37c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 11 additions and 1 deletions

View file

@ -551,6 +551,7 @@ export const openAiModelInfoSaneDefaults: ModelInfo = {
inputPrice: 0,
outputPrice: 0,
supportsNativeTools: true,
defaultToolProtocol: "native",
}
// https://learn.microsoft.com/en-us/azure/ai-services/openai/api-version-deprecation

View file

@ -1,6 +1,6 @@
import { describe, it, expect } from "vitest"
import { resolveToolProtocol } from "../resolveToolProtocol"
import { TOOL_PROTOCOL } from "@roo-code/types"
import { TOOL_PROTOCOL, openAiModelInfoSaneDefaults } from "@roo-code/types"
import type { ProviderSettings, ModelInfo } from "@roo-code/types"
describe("resolveToolProtocol", () => {
@ -316,5 +316,14 @@ describe("resolveToolProtocol", () => {
const result = resolveToolProtocol(settings, modelInfo)
expect(result).toBe(TOOL_PROTOCOL.XML) // Model default wins
})
it("should use native tools for OpenAI compatible provider with default model info", () => {
const settings: ProviderSettings = {
apiProvider: "openai",
}
// Using the actual openAiModelInfoSaneDefaults to verify the fix
const result = resolveToolProtocol(settings, openAiModelInfoSaneDefaults)
expect(result).toBe(TOOL_PROTOCOL.NATIVE) // Should use native tools by default
})
})
})