Skip to content

Commit 64d197e

Browse files
committed
fix: update tests to reflect defaultToolProtocol: native for all Roo models
1 parent 5c0377c commit 64d197e

File tree

1 file changed

+21
-13
lines changed

1 file changed

+21
-13
lines changed

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

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,9 @@ describe("getRooModels", () => {
127127
description: "Model that requires reasoning",
128128
deprecated: false,
129129
isFree: false,
130+
defaultTemperature: undefined,
131+
defaultToolProtocol: "native",
132+
isStealthModel: undefined,
130133
})
131134
})
132135

@@ -174,6 +177,9 @@ describe("getRooModels", () => {
174177
description: "Normal model without reasoning",
175178
deprecated: false,
176179
isFree: false,
180+
defaultTemperature: undefined,
181+
defaultToolProtocol: "native",
182+
isStealthModel: undefined,
177183
})
178184
})
179185

@@ -578,21 +584,21 @@ describe("getRooModels", () => {
578584
expect(models["test/native-tools-model"].defaultToolProtocol).toBe("native")
579585
})
580586

581-
it("should imply supportsNativeTools when default-native-tools tag is present without tool-use tag", async () => {
587+
it("should set defaultToolProtocol to native for all models regardless of tags", async () => {
582588
const mockResponse = {
583589
object: "list",
584590
data: [
585591
{
586-
id: "test/implicit-native-tools",
592+
id: "test/model-without-tool-tags",
587593
object: "model",
588594
created: 1234567890,
589595
owned_by: "test",
590-
name: "Implicit Native Tools Model",
591-
description: "Model with default-native-tools but no tool-use tag",
596+
name: "Model Without Tool Tags",
597+
description: "Model without any tool-related tags",
592598
context_window: 128000,
593599
max_tokens: 8192,
594600
type: "language",
595-
tags: ["default-native-tools"], // Only default-native-tools, no tool-use
601+
tags: [], // No tool-related tags
596602
pricing: {
597603
input: "0.0001",
598604
output: "0.0002",
@@ -608,21 +614,22 @@ describe("getRooModels", () => {
608614

609615
const models = await getRooModels(baseUrl, apiKey)
610616

611-
expect(models["test/implicit-native-tools"].supportsNativeTools).toBe(true)
612-
expect(models["test/implicit-native-tools"].defaultToolProtocol).toBe("native")
617+
// All Roo provider models now default to native tool protocol
618+
expect(models["test/model-without-tool-tags"].supportsNativeTools).toBe(false)
619+
expect(models["test/model-without-tool-tags"].defaultToolProtocol).toBe("native")
613620
})
614621

615-
it("should not set defaultToolProtocol when default-native-tools tag is not present", async () => {
622+
it("should set supportsNativeTools from tool-use tag and always set defaultToolProtocol to native", async () => {
616623
const mockResponse = {
617624
object: "list",
618625
data: [
619626
{
620-
id: "test/non-native-model",
627+
id: "test/tool-use-model",
621628
object: "model",
622629
created: 1234567890,
623630
owned_by: "test",
624-
name: "Non-Native Tools Model",
625-
description: "Model without native tool calling default",
631+
name: "Tool Use Model",
632+
description: "Model with tool-use tag",
626633
context_window: 128000,
627634
max_tokens: 8192,
628635
type: "language",
@@ -642,8 +649,9 @@ describe("getRooModels", () => {
642649

643650
const models = await getRooModels(baseUrl, apiKey)
644651

645-
expect(models["test/non-native-model"].supportsNativeTools).toBe(true)
646-
expect(models["test/non-native-model"].defaultToolProtocol).toBeUndefined()
652+
// tool-use tag sets supportsNativeTools, and all models get defaultToolProtocol: native
653+
expect(models["test/tool-use-model"].supportsNativeTools).toBe(true)
654+
expect(models["test/tool-use-model"].defaultToolProtocol).toBe("native")
647655
})
648656

649657
it("should detect stealth mode from tags", async () => {

0 commit comments

Comments
 (0)