mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-07 08:26:51 +00:00
fix: enable native tools by default for OpenAI compatible provider (#10159)
This commit is contained in:
parent
aa3b4ae9cc
commit
2a2411d37c
2 changed files with 11 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue