From 931b3432c5de54ff8c2f864d74939ba6e2dde62e Mon Sep 17 00:00:00 2001 From: Slava Date: Mon, 8 Jun 2026 14:58:12 -0400 Subject: [PATCH 1/6] feat: add gpt-5.5 support --- packages/types/src/providers/openai.ts | 26 ++++++++ .../providers/__tests__/openai-native.spec.ts | 65 +++++++++++++++++++ 2 files changed, 91 insertions(+) diff --git a/packages/types/src/providers/openai.ts b/packages/types/src/providers/openai.ts index 81a022c663..83a1898603 100644 --- a/packages/types/src/providers/openai.ts +++ b/packages/types/src/providers/openai.ts @@ -24,6 +24,32 @@ export const openAiNativeModels = { description: "GPT-5.1 Codex Max: Our most intelligent coding model optimized for long-horizon, agentic coding tasks", }, + "gpt-5.5": { + maxTokens: 128000, + contextWindow: 1_050_000, + includedTools: ["apply_patch"], + excludedTools: ["apply_diff", "write_to_file"], + supportsImages: true, + supportsPromptCache: true, + supportsReasoningEffort: ["none", "low", "medium", "high", "xhigh"], + reasoningEffort: "none", + inputPrice: 5.0, + outputPrice: 30.0, + cacheReadsPrice: 0.5, + longContextPricing: { + thresholdTokens: 272_000, + inputPriceMultiplier: 2, + outputPriceMultiplier: 1.5, + appliesToServiceTiers: ["default", "flex"], + }, + supportsVerbosity: true, + supportsTemperature: false, + tiers: [ + { name: "flex", contextWindow: 1_050_000, inputPrice: 2.5, outputPrice: 15.0, cacheReadsPrice: 0.25 }, + { name: "priority", contextWindow: 1_050_000, inputPrice: 12.5, outputPrice: 75.0, cacheReadsPrice: 1.25 }, + ], + description: "GPT-5.5: A new class of intelligence for coding and professional work", + }, "gpt-5.4": { maxTokens: 128000, contextWindow: 1_050_000, diff --git a/src/api/providers/__tests__/openai-native.spec.ts b/src/api/providers/__tests__/openai-native.spec.ts index 4337df18cf..e0b86f0348 100644 --- a/src/api/providers/__tests__/openai-native.spec.ts +++ b/src/api/providers/__tests__/openai-native.spec.ts @@ -267,6 +267,21 @@ describe("OpenAiNativeHandler", () => { expect(modelInfo.info.supportsReasoningEffort).toEqual(["low", "medium", "high", "xhigh"]) }) + it("should return GPT-5.5 model info when selected", () => { + const gpt54Handler = new OpenAiNativeHandler({ + ...mockOptions, + apiModelId: "gpt-5.5", + }) + + const modelInfo = gpt54Handler.getModel() + expect(modelInfo.id).toBe("gpt-5.5") + expect(modelInfo.info.maxTokens).toBe(128000) + expect(modelInfo.info.contextWindow).toBe(1_050_000) + expect(modelInfo.info.supportsVerbosity).toBe(true) + expect(modelInfo.info.supportsReasoningEffort).toEqual(["none", "low", "medium", "high", "xhigh"]) + expect(modelInfo.info.reasoningEffort).toBe("none") + }) + it("should return GPT-5.4 model info when selected", () => { const gpt54Handler = new OpenAiNativeHandler({ ...mockOptions, @@ -430,6 +445,56 @@ describe("OpenAiNativeHandler", () => { expect(textChunks[1].text).toBe(" world") }) + it("should handle GPT-5.5 model with Responses API", async () => { + const mockFetch = vitest.fn().mockResolvedValue({ + ok: true, + body: new ReadableStream({ + start(controller) { + controller.enqueue( + new TextEncoder().encode( + 'data: {"type":"response.output_item.added","item":{"type":"text","text":"GPT-5.5 reply"}}\n\n', + ), + ) + controller.enqueue(new TextEncoder().encode("data: [DONE]\n\n")) + controller.close() + }, + }), + }) + global.fetch = mockFetch as any + + mockResponsesCreate.mockRejectedValue(new Error("SDK not available")) + + handler = new OpenAiNativeHandler({ + ...mockOptions, + apiModelId: "gpt-5.5", + }) + + const stream = handler.createMessage(systemPrompt, messages) + const chunks: any[] = [] + for await (const chunk of stream) { + chunks.push(chunk) + } + + expect(mockFetch).toHaveBeenCalledWith( + "https://api.openai.com/v1/responses", + expect.objectContaining({ + body: expect.any(String), + }), + ) + const body = (mockFetch.mock.calls[0][1] as any).body as string + const parsedBody = JSON.parse(body) + expect(parsedBody.model).toBe("gpt-5.5") + expect(parsedBody.max_output_tokens).toBe(128000) + expect(parsedBody.temperature).toBeUndefined() + expect(parsedBody.include).toEqual(["reasoning.encrypted_content"]) + expect(parsedBody.reasoning?.effort).toBe("none") + expect(parsedBody.text?.verbosity).toBe("medium") + + const textChunks = chunks.filter((chunk) => chunk.type === "text") + expect(textChunks).toHaveLength(1) + expect(textChunks[0].text).toBe("GPT-5.5 reply") + }) + it("should handle GPT-5.4 model with Responses API", async () => { const mockFetch = vitest.fn().mockResolvedValue({ ok: true, From daf2475fbc54c274cde84ce52fada8231e9b7984 Mon Sep 17 00:00:00 2001 From: edelauna <54631123+edelauna@users.noreply.github.com> Date: Tue, 9 Jun 2026 11:19:45 -0400 Subject: [PATCH 2/6] Update openai.ts --- packages/types/src/providers/openai.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/types/src/providers/openai.ts b/packages/types/src/providers/openai.ts index 83a1898603..4f04af0a63 100644 --- a/packages/types/src/providers/openai.ts +++ b/packages/types/src/providers/openai.ts @@ -32,7 +32,7 @@ export const openAiNativeModels = { supportsImages: true, supportsPromptCache: true, supportsReasoningEffort: ["none", "low", "medium", "high", "xhigh"], - reasoningEffort: "none", + reasoningEffort: "medium", inputPrice: 5.0, outputPrice: 30.0, cacheReadsPrice: 0.5, From c6a63343f5eaf125270dda1931f6e803e4e0b4f1 Mon Sep 17 00:00:00 2001 From: edelauna <54631123+edelauna@users.noreply.github.com> Date: Tue, 9 Jun 2026 11:19:54 -0400 Subject: [PATCH 3/6] Update openai-native.spec.ts --- src/api/providers/__tests__/openai-native.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/providers/__tests__/openai-native.spec.ts b/src/api/providers/__tests__/openai-native.spec.ts index e0b86f0348..5b46273f53 100644 --- a/src/api/providers/__tests__/openai-native.spec.ts +++ b/src/api/providers/__tests__/openai-native.spec.ts @@ -268,7 +268,7 @@ describe("OpenAiNativeHandler", () => { }) it("should return GPT-5.5 model info when selected", () => { - const gpt54Handler = new OpenAiNativeHandler({ + const gpt55Handler = new OpenAiNativeHandler({ ...mockOptions, apiModelId: "gpt-5.5", }) From 7f8195ef8784a2ac8c9700489fdd79291b044116 Mon Sep 17 00:00:00 2001 From: edelauna <54631123+edelauna@users.noreply.github.com> Date: Tue, 9 Jun 2026 11:20:04 -0400 Subject: [PATCH 4/6] Update openai-native.spec.ts --- src/api/providers/__tests__/openai-native.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/providers/__tests__/openai-native.spec.ts b/src/api/providers/__tests__/openai-native.spec.ts index 5b46273f53..96f872cebf 100644 --- a/src/api/providers/__tests__/openai-native.spec.ts +++ b/src/api/providers/__tests__/openai-native.spec.ts @@ -273,7 +273,7 @@ describe("OpenAiNativeHandler", () => { apiModelId: "gpt-5.5", }) - const modelInfo = gpt54Handler.getModel() + const modelInfo = gpt55Handler.getModel() expect(modelInfo.id).toBe("gpt-5.5") expect(modelInfo.info.maxTokens).toBe(128000) expect(modelInfo.info.contextWindow).toBe(1_050_000) From 699325e93cc773c13afeabac027bc46808feaf32 Mon Sep 17 00:00:00 2001 From: edelauna <54631123+edelauna@users.noreply.github.com> Date: Tue, 9 Jun 2026 11:20:14 -0400 Subject: [PATCH 5/6] Update openai-native.spec.ts --- src/api/providers/__tests__/openai-native.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/providers/__tests__/openai-native.spec.ts b/src/api/providers/__tests__/openai-native.spec.ts index 96f872cebf..743d1d5b56 100644 --- a/src/api/providers/__tests__/openai-native.spec.ts +++ b/src/api/providers/__tests__/openai-native.spec.ts @@ -279,7 +279,7 @@ describe("OpenAiNativeHandler", () => { expect(modelInfo.info.contextWindow).toBe(1_050_000) expect(modelInfo.info.supportsVerbosity).toBe(true) expect(modelInfo.info.supportsReasoningEffort).toEqual(["none", "low", "medium", "high", "xhigh"]) - expect(modelInfo.info.reasoningEffort).toBe("none") + expect(modelInfo.info.reasoningEffort).toBe("medium") }) it("should return GPT-5.4 model info when selected", () => { From 91b28f53f97f82296cc614ea4b2276347a738777 Mon Sep 17 00:00:00 2001 From: edelauna <54631123+edelauna@users.noreply.github.com> Date: Tue, 9 Jun 2026 11:20:24 -0400 Subject: [PATCH 6/6] Update openai-native.spec.ts --- src/api/providers/__tests__/openai-native.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/providers/__tests__/openai-native.spec.ts b/src/api/providers/__tests__/openai-native.spec.ts index 743d1d5b56..021178351b 100644 --- a/src/api/providers/__tests__/openai-native.spec.ts +++ b/src/api/providers/__tests__/openai-native.spec.ts @@ -487,7 +487,7 @@ describe("OpenAiNativeHandler", () => { expect(parsedBody.max_output_tokens).toBe(128000) expect(parsedBody.temperature).toBeUndefined() expect(parsedBody.include).toEqual(["reasoning.encrypted_content"]) - expect(parsedBody.reasoning?.effort).toBe("none") + expect(parsedBody.reasoning?.effort).toBe("medium") expect(parsedBody.text?.verbosity).toBe("medium") const textChunks = chunks.filter((chunk) => chunk.type === "text")