Matt Rubens 8 months ago
parent
commit
ab7ca17f29

+ 5 - 0
.changeset/purple-oranges-eat.md

@@ -0,0 +1,5 @@
+---
+"roo-cline": patch
+---
+
+v3.11.16

+ 9 - 9
src/api/providers/__tests__/openai-native.test.ts

@@ -76,7 +76,7 @@ describe("OpenAiNativeHandler", () => {
 
 	beforeEach(() => {
 		mockOptions = {
-			apiModelId: "gpt-4o",
+			apiModelId: "gpt-4.1",
 			openAiNativeApiKey: "test-api-key",
 		}
 		handler = new OpenAiNativeHandler(mockOptions)
@@ -91,7 +91,7 @@ describe("OpenAiNativeHandler", () => {
 
 		it("should initialize with empty API key", () => {
 			const handlerWithoutKey = new OpenAiNativeHandler({
-				apiModelId: "gpt-4o",
+				apiModelId: "gpt-4.1",
 				openAiNativeApiKey: "",
 			})
 			expect(handlerWithoutKey).toBeInstanceOf(OpenAiNativeHandler)
@@ -196,7 +196,7 @@ describe("OpenAiNativeHandler", () => {
 		beforeEach(() => {
 			handler = new OpenAiNativeHandler({
 				...mockOptions,
-				apiModelId: "gpt-4o",
+				apiModelId: "gpt-4.1",
 			})
 		})
 
@@ -229,7 +229,7 @@ describe("OpenAiNativeHandler", () => {
 			])
 
 			expect(mockCreate).toHaveBeenCalledWith({
-				model: "gpt-4o",
+				model: "gpt-4.1",
 				temperature: 0,
 				messages: [
 					{ role: "system", content: systemPrompt },
@@ -269,11 +269,11 @@ describe("OpenAiNativeHandler", () => {
 	})
 
 	describe("completePrompt", () => {
-		it("should complete prompt successfully with gpt-4o model", async () => {
+		it("should complete prompt successfully with gpt-4.1 model", async () => {
 			const result = await handler.completePrompt("Test prompt")
 			expect(result).toBe("Test response")
 			expect(mockCreate).toHaveBeenCalledWith({
-				model: "gpt-4o",
+				model: "gpt-4.1",
 				messages: [{ role: "user", content: "Test prompt" }],
 				temperature: 0,
 			})
@@ -357,8 +357,8 @@ describe("OpenAiNativeHandler", () => {
 			const modelInfo = handler.getModel()
 			expect(modelInfo.id).toBe(mockOptions.apiModelId)
 			expect(modelInfo.info).toBeDefined()
-			expect(modelInfo.info.maxTokens).toBe(16384)
-			expect(modelInfo.info.contextWindow).toBe(128_000)
+			expect(modelInfo.info.maxTokens).toBe(32768)
+			expect(modelInfo.info.contextWindow).toBe(1047576)
 		})
 
 		it("should handle undefined model ID", () => {
@@ -366,7 +366,7 @@ describe("OpenAiNativeHandler", () => {
 				openAiNativeApiKey: "test-api-key",
 			})
 			const modelInfo = handlerWithoutModel.getModel()
-			expect(modelInfo.id).toBe("gpt-4o") // Default model
+			expect(modelInfo.id).toBe("gpt-4.1") // Default model
 			expect(modelInfo.info).toBeDefined()
 		})
 	})