From 3c7d9da925cdabe2c88bcce419aaed8663b1f0c6 Mon Sep 17 00:00:00 2001 From: Hannes Rudolph Date: Thu, 11 Dec 2025 11:50:24 -0700 Subject: [PATCH 1/4] feat: add gpt-5.2 model to openai-native provider - Add gpt-5.2 model with 400k context, 128k max output tokens - Support reasoning efforts: none, low, medium, high, xhigh - Pricing: $1.75/M input, $14/M output (standard tier) - Flex tier: $0.875/M input, $7/M output - Priority tier: $3.50/M input, $28/M output - Set gpt-5.2 as the new default model - Update test to expect new default model --- packages/types/src/providers/openai.ts | 24 ++++++++++++++++++- .../providers/__tests__/openai-native.spec.ts | 2 +- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/packages/types/src/providers/openai.ts b/packages/types/src/providers/openai.ts index 722b57677cc..448ec380a38 100644 --- a/packages/types/src/providers/openai.ts +++ b/packages/types/src/providers/openai.ts @@ -3,9 +3,31 @@ import type { ModelInfo } from "../model.js" // https://openai.com/api/pricing/ export type OpenAiNativeModelId = keyof typeof openAiNativeModels -export const openAiNativeDefaultModelId: OpenAiNativeModelId = "gpt-5.1" +export const openAiNativeDefaultModelId: OpenAiNativeModelId = "gpt-5.2" export const openAiNativeModels = { + "gpt-5.2": { + maxTokens: 128000, + contextWindow: 400000, + supportsNativeTools: true, + includedTools: ["apply_patch"], + excludedTools: ["apply_diff", "write_to_file"], + supportsImages: true, + supportsPromptCache: true, + promptCacheRetention: "24h", + supportsReasoningEffort: ["none", "low", "medium", "high", "xhigh"], + reasoningEffort: "medium", + inputPrice: 1.75, + outputPrice: 14.0, + cacheReadsPrice: 0.175, + supportsVerbosity: true, + supportsTemperature: false, + tiers: [ + { name: "flex", contextWindow: 400000, inputPrice: 0.875, outputPrice: 7.0, cacheReadsPrice: 0.0875 }, + { name: "priority", contextWindow: 400000, inputPrice: 3.5, outputPrice: 28.0, cacheReadsPrice: 0.35 }, + ], + description: "GPT-5.2: Our flagship model for coding and agentic tasks across industries", + }, "gpt-5.1-codex-max": { maxTokens: 128000, contextWindow: 400000, diff --git a/src/api/providers/__tests__/openai-native.spec.ts b/src/api/providers/__tests__/openai-native.spec.ts index 0482b8893b8..33e7bfe0d40 100644 --- a/src/api/providers/__tests__/openai-native.spec.ts +++ b/src/api/providers/__tests__/openai-native.spec.ts @@ -205,7 +205,7 @@ describe("OpenAiNativeHandler", () => { openAiNativeApiKey: "test-api-key", }) const modelInfo = handlerWithoutModel.getModel() - expect(modelInfo.id).toBe("gpt-5.1") // Default model + expect(modelInfo.id).toBe("gpt-5.2") // Default model expect(modelInfo.info).toBeDefined() }) }) From e53dfff4bd0a3258a9b7e373c44b5c9b6c76bbb9 Mon Sep 17 00:00:00 2001 From: Hannes Rudolph Date: Thu, 11 Dec 2025 12:52:00 -0700 Subject: [PATCH 2/4] feat: add gpt-5.2-chat-latest model - Add gpt-5.2-chat-latest with 128k context, 16k max output tokens - Pricing: $1.75/M input, $0.175/M cache, $14.00/M output - Optimized for conversational AI and chat use cases --- packages/types/src/providers/openai.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/packages/types/src/providers/openai.ts b/packages/types/src/providers/openai.ts index 448ec380a38..abfadfe50b0 100644 --- a/packages/types/src/providers/openai.ts +++ b/packages/types/src/providers/openai.ts @@ -28,6 +28,17 @@ export const openAiNativeModels = { ], description: "GPT-5.2: Our flagship model for coding and agentic tasks across industries", }, + "gpt-5.2-chat-latest": { + maxTokens: 16_384, + contextWindow: 128_000, + supportsNativeTools: true, + supportsImages: true, + supportsPromptCache: true, + inputPrice: 1.75, + outputPrice: 14.0, + cacheReadsPrice: 0.175, + description: "GPT-5.2 Chat: Optimized for conversational AI and chat use cases", + }, "gpt-5.1-codex-max": { maxTokens: 128000, contextWindow: 400000, From 5212a0e69367545e1314a83d2f04e7158816541a Mon Sep 17 00:00:00 2001 From: Hannes Rudolph Date: Thu, 11 Dec 2025 12:55:51 -0700 Subject: [PATCH 3/4] feat: add gpt-5.2 model and set gpt-5.1-codex-max as default with xhigh reasoning --- packages/types/src/providers/openai.ts | 40 +++++++++---------- .../providers/__tests__/openai-native.spec.ts | 2 +- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/packages/types/src/providers/openai.ts b/packages/types/src/providers/openai.ts index abfadfe50b0..4e439b7b42a 100644 --- a/packages/types/src/providers/openai.ts +++ b/packages/types/src/providers/openai.ts @@ -3,9 +3,28 @@ import type { ModelInfo } from "../model.js" // https://openai.com/api/pricing/ export type OpenAiNativeModelId = keyof typeof openAiNativeModels -export const openAiNativeDefaultModelId: OpenAiNativeModelId = "gpt-5.2" +export const openAiNativeDefaultModelId: OpenAiNativeModelId = "gpt-5.1-codex-max" export const openAiNativeModels = { + "gpt-5.1-codex-max": { + maxTokens: 128000, + contextWindow: 400000, + supportsNativeTools: true, + includedTools: ["apply_patch"], + excludedTools: ["apply_diff", "write_to_file"], + supportsImages: true, + supportsPromptCache: true, + promptCacheRetention: "24h", + supportsReasoningEffort: ["low", "medium", "high", "xhigh"], + reasoningEffort: "xhigh", + inputPrice: 1.25, + outputPrice: 10.0, + cacheReadsPrice: 0.125, + supportsTemperature: false, + tiers: [{ name: "priority", contextWindow: 400000, inputPrice: 2.5, outputPrice: 20.0, cacheReadsPrice: 0.25 }], + description: + "GPT-5.1 Codex Max: Our most intelligent coding model optimized for long-horizon, agentic coding tasks", + }, "gpt-5.2": { maxTokens: 128000, contextWindow: 400000, @@ -39,25 +58,6 @@ export const openAiNativeModels = { cacheReadsPrice: 0.175, description: "GPT-5.2 Chat: Optimized for conversational AI and chat use cases", }, - "gpt-5.1-codex-max": { - maxTokens: 128000, - contextWindow: 400000, - supportsNativeTools: true, - includedTools: ["apply_patch"], - excludedTools: ["apply_diff", "write_to_file"], - supportsImages: true, - supportsPromptCache: true, - promptCacheRetention: "24h", - supportsReasoningEffort: ["low", "medium", "high", "xhigh"], - reasoningEffort: "medium", - inputPrice: 1.25, - outputPrice: 10.0, - cacheReadsPrice: 0.125, - supportsTemperature: false, - tiers: [{ name: "priority", contextWindow: 400000, inputPrice: 2.5, outputPrice: 20.0, cacheReadsPrice: 0.25 }], - description: - "GPT-5.1 Codex Max: Our most intelligent coding model optimized for long-horizon, agentic coding tasks", - }, "gpt-5.1": { maxTokens: 128000, contextWindow: 400000, diff --git a/src/api/providers/__tests__/openai-native.spec.ts b/src/api/providers/__tests__/openai-native.spec.ts index 33e7bfe0d40..3196316f639 100644 --- a/src/api/providers/__tests__/openai-native.spec.ts +++ b/src/api/providers/__tests__/openai-native.spec.ts @@ -205,7 +205,7 @@ describe("OpenAiNativeHandler", () => { openAiNativeApiKey: "test-api-key", }) const modelInfo = handlerWithoutModel.getModel() - expect(modelInfo.id).toBe("gpt-5.2") // Default model + expect(modelInfo.id).toBe("gpt-5.1-codex-max") // Default model expect(modelInfo.info).toBeDefined() }) }) From eb44189f827eaf88f690ba6ea7562c0f230e67c4 Mon Sep 17 00:00:00 2001 From: Hannes Rudolph Date: Thu, 11 Dec 2025 13:06:22 -0700 Subject: [PATCH 4/4] fix: add missing includedTools and excludedTools to gpt-5.2-chat-latest Add tool restrictions to gpt-5.2-chat-latest for consistency with gpt-5-chat-latest and other GPT-5 model definitions. --- packages/types/src/providers/openai.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/types/src/providers/openai.ts b/packages/types/src/providers/openai.ts index 4e439b7b42a..264c5aa40f5 100644 --- a/packages/types/src/providers/openai.ts +++ b/packages/types/src/providers/openai.ts @@ -51,6 +51,8 @@ export const openAiNativeModels = { maxTokens: 16_384, contextWindow: 128_000, supportsNativeTools: true, + includedTools: ["apply_patch"], + excludedTools: ["apply_diff", "write_to_file"], supportsImages: true, supportsPromptCache: true, inputPrice: 1.75,