Skip to content

Commit ab7ca17

Browse files
authored
Fix test (#2607)
1 parent 929503a commit ab7ca17

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

.changeset/purple-oranges-eat.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"roo-cline": patch
3+
---
4+
5+
v3.11.16

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ describe("OpenAiNativeHandler", () => {
7676

7777
beforeEach(() => {
7878
mockOptions = {
79-
apiModelId: "gpt-4o",
79+
apiModelId: "gpt-4.1",
8080
openAiNativeApiKey: "test-api-key",
8181
}
8282
handler = new OpenAiNativeHandler(mockOptions)
@@ -91,7 +91,7 @@ describe("OpenAiNativeHandler", () => {
9191

9292
it("should initialize with empty API key", () => {
9393
const handlerWithoutKey = new OpenAiNativeHandler({
94-
apiModelId: "gpt-4o",
94+
apiModelId: "gpt-4.1",
9595
openAiNativeApiKey: "",
9696
})
9797
expect(handlerWithoutKey).toBeInstanceOf(OpenAiNativeHandler)
@@ -196,7 +196,7 @@ describe("OpenAiNativeHandler", () => {
196196
beforeEach(() => {
197197
handler = new OpenAiNativeHandler({
198198
...mockOptions,
199-
apiModelId: "gpt-4o",
199+
apiModelId: "gpt-4.1",
200200
})
201201
})
202202

@@ -229,7 +229,7 @@ describe("OpenAiNativeHandler", () => {
229229
])
230230

231231
expect(mockCreate).toHaveBeenCalledWith({
232-
model: "gpt-4o",
232+
model: "gpt-4.1",
233233
temperature: 0,
234234
messages: [
235235
{ role: "system", content: systemPrompt },
@@ -269,11 +269,11 @@ describe("OpenAiNativeHandler", () => {
269269
})
270270

271271
describe("completePrompt", () => {
272-
it("should complete prompt successfully with gpt-4o model", async () => {
272+
it("should complete prompt successfully with gpt-4.1 model", async () => {
273273
const result = await handler.completePrompt("Test prompt")
274274
expect(result).toBe("Test response")
275275
expect(mockCreate).toHaveBeenCalledWith({
276-
model: "gpt-4o",
276+
model: "gpt-4.1",
277277
messages: [{ role: "user", content: "Test prompt" }],
278278
temperature: 0,
279279
})
@@ -357,16 +357,16 @@ describe("OpenAiNativeHandler", () => {
357357
const modelInfo = handler.getModel()
358358
expect(modelInfo.id).toBe(mockOptions.apiModelId)
359359
expect(modelInfo.info).toBeDefined()
360-
expect(modelInfo.info.maxTokens).toBe(16384)
361-
expect(modelInfo.info.contextWindow).toBe(128_000)
360+
expect(modelInfo.info.maxTokens).toBe(32768)
361+
expect(modelInfo.info.contextWindow).toBe(1047576)
362362
})
363363

364364
it("should handle undefined model ID", () => {
365365
const handlerWithoutModel = new OpenAiNativeHandler({
366366
openAiNativeApiKey: "test-api-key",
367367
})
368368
const modelInfo = handlerWithoutModel.getModel()
369-
expect(modelInfo.id).toBe("gpt-4o") // Default model
369+
expect(modelInfo.id).toBe("gpt-4.1") // Default model
370370
expect(modelInfo.info).toBeDefined()
371371
})
372372
})

0 commit comments

Comments
 (0)