Skip to content

Commit 5c0377c

Browse files
committed
Default to native tools for all models in the Roo provider
1 parent d065b88 commit 5c0377c

File tree

2 files changed

+14
-36
lines changed

2 files changed

+14
-36
lines changed

src/api/providers/__tests__/roo.spec.ts

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ vitest.mock("../../providers/fetchers/modelCache", () => ({
101101
supportsPromptCache: true,
102102
inputPrice: 0,
103103
outputPrice: 0,
104+
defaultToolProtocol: "native",
104105
},
105106
"minimax/minimax-m2:free": {
106107
maxTokens: 32_768,
@@ -110,6 +111,7 @@ vitest.mock("../../providers/fetchers/modelCache", () => ({
110111
supportsNativeTools: true,
111112
inputPrice: 0.15,
112113
outputPrice: 0.6,
114+
defaultToolProtocol: "native",
113115
},
114116
"anthropic/claude-haiku-4.5": {
115117
maxTokens: 8_192,
@@ -119,6 +121,7 @@ vitest.mock("../../providers/fetchers/modelCache", () => ({
119121
supportsNativeTools: true,
120122
inputPrice: 0.8,
121123
outputPrice: 4,
124+
defaultToolProtocol: "native",
122125
},
123126
}
124127
}
@@ -425,28 +428,15 @@ describe("RooHandler", () => {
425428
}
426429
})
427430

428-
it("should apply defaultToolProtocol: native for minimax/minimax-m2:free", () => {
429-
const handlerWithMinimax = new RooHandler({
430-
apiModelId: "minimax/minimax-m2:free",
431-
})
432-
const modelInfo = handlerWithMinimax.getModel()
433-
expect(modelInfo.id).toBe("minimax/minimax-m2:free")
434-
expect((modelInfo.info as any).defaultToolProtocol).toBe("native")
435-
// Verify cached model info is preserved
436-
expect(modelInfo.info.maxTokens).toBe(32_768)
437-
expect(modelInfo.info.contextWindow).toBe(1_000_000)
438-
})
439-
440-
it("should apply defaultToolProtocol: native for anthropic/claude-haiku-4.5", () => {
441-
const handlerWithHaiku = new RooHandler({
442-
apiModelId: "anthropic/claude-haiku-4.5",
443-
})
444-
const modelInfo = handlerWithHaiku.getModel()
445-
expect(modelInfo.id).toBe("anthropic/claude-haiku-4.5")
446-
expect((modelInfo.info as any).defaultToolProtocol).toBe("native")
447-
// Verify cached model info is preserved
448-
expect(modelInfo.info.maxTokens).toBe(8_192)
449-
expect(modelInfo.info.contextWindow).toBe(200_000)
431+
it("should have defaultToolProtocol: native for all roo provider models", () => {
432+
// Test that all models have defaultToolProtocol: native
433+
const testModels = ["minimax/minimax-m2:free", "anthropic/claude-haiku-4.5", "xai/grok-code-fast-1"]
434+
for (const modelId of testModels) {
435+
const handlerWithModel = new RooHandler({ apiModelId: modelId })
436+
const modelInfo = handlerWithModel.getModel()
437+
expect(modelInfo.id).toBe(modelId)
438+
expect((modelInfo.info as any).defaultToolProtocol).toBe("native")
439+
}
450440
})
451441

452442
it("should not override existing properties when applying MODEL_DEFAULTS", () => {

src/api/providers/fetchers/roo.ts

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,9 @@ import { DEFAULT_HEADERS } from "../constants"
1010
// Exported so RooHandler.getModel() can also apply these for fallback cases
1111
export const MODEL_DEFAULTS: Record<string, Partial<ModelInfo>> = {
1212
"minimax/minimax-m2:free": {
13-
defaultToolProtocol: "native",
1413
includedTools: ["search_and_replace"],
1514
excludedTools: ["apply_diff"],
1615
},
17-
"anthropic/claude-haiku-4.5": {
18-
defaultToolProtocol: "native",
19-
},
20-
"xai/grok-code-fast-1": {
21-
defaultToolProtocol: "native",
22-
},
2316
}
2417

2518
/**
@@ -109,13 +102,8 @@ export async function getRooModels(baseUrl: string, apiKey?: string): Promise<Mo
109102
// Determine if the model requires reasoning effort based on tags
110103
const requiredReasoningEffort = tags.includes("reasoning-required")
111104

112-
// Determine if native tool calling should be the default protocol for this model
113-
const hasDefaultNativeTools = tags.includes("default-native-tools")
114-
const defaultToolProtocol = hasDefaultNativeTools ? ("native" as const) : undefined
115-
116105
// Determine if the model supports native tool calling based on tags
117-
// default-native-tools implies tool-use support
118-
const supportsNativeTools = tags.includes("tool-use") || hasDefaultNativeTools
106+
const supportsNativeTools = tags.includes("tool-use")
119107

120108
// Determine if the model should hide vendor/company identity (stealth mode)
121109
const isStealthModel = tags.includes("stealth")
@@ -143,7 +131,7 @@ export async function getRooModels(baseUrl: string, apiKey?: string): Promise<Mo
143131
deprecated: model.deprecated || false,
144132
isFree: tags.includes("free"),
145133
defaultTemperature: model.default_temperature,
146-
defaultToolProtocol,
134+
defaultToolProtocol: "native" as const,
147135
isStealthModel: isStealthModel || undefined,
148136
}
149137

0 commit comments

Comments
 (0)