From e633c62e70bb3dda6f74d0fca39c8e5a8bed5a47 Mon Sep 17 00:00:00 2001 From: Hannes Rudolph Date: Thu, 4 Dec 2025 22:35:45 -0700 Subject: [PATCH] chore: restrict gpt-5 tool set to apply_patch (#9853) --- packages/types/src/providers/openai.ts | 64 +++++++++++++++++++------- 1 file changed, 47 insertions(+), 17 deletions(-) diff --git a/packages/types/src/providers/openai.ts b/packages/types/src/providers/openai.ts index fb0837c3c6..a896e5b6ac 100644 --- a/packages/types/src/providers/openai.ts +++ b/packages/types/src/providers/openai.ts @@ -6,10 +6,31 @@ export type OpenAiNativeModelId = keyof typeof openAiNativeModels export const openAiNativeDefaultModelId: OpenAiNativeModelId = "gpt-5.1" 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"], + 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, supportsNativeTools: true, + includedTools: ["apply_patch"], + excludedTools: ["apply_diff", "write_to_file"], supportsImages: true, supportsPromptCache: true, promptCacheRetention: "24h", @@ -30,6 +51,8 @@ export const openAiNativeModels = { maxTokens: 128000, contextWindow: 400000, supportsNativeTools: true, + includedTools: ["apply_patch"], + excludedTools: ["apply_diff", "write_to_file"], supportsImages: true, supportsPromptCache: true, promptCacheRetention: "24h", @@ -42,27 +65,12 @@ export const openAiNativeModels = { tiers: [{ name: "priority", contextWindow: 400000, inputPrice: 2.5, outputPrice: 20.0, cacheReadsPrice: 0.25 }], description: "GPT-5.1 Codex: A version of GPT-5.1 optimized for agentic coding in Codex", }, - "gpt-5.1-codex-max": { - maxTokens: 128000, - contextWindow: 400000, - supportsNativeTools: true, - supportsImages: true, - supportsPromptCache: true, - promptCacheRetention: "24h", - supportsReasoningEffort: ["low", "medium", "high"], - 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-codex-mini": { maxTokens: 128000, contextWindow: 400000, supportsNativeTools: true, + includedTools: ["apply_patch"], + excludedTools: ["apply_diff", "write_to_file"], supportsImages: true, supportsPromptCache: true, promptCacheRetention: "24h", @@ -78,6 +86,8 @@ export const openAiNativeModels = { maxTokens: 128000, contextWindow: 400000, supportsNativeTools: true, + includedTools: ["apply_patch"], + excludedTools: ["apply_diff", "write_to_file"], supportsImages: true, supportsPromptCache: true, supportsReasoningEffort: ["minimal", "low", "medium", "high"], @@ -97,6 +107,8 @@ export const openAiNativeModels = { maxTokens: 128000, contextWindow: 400000, supportsNativeTools: true, + includedTools: ["apply_patch"], + excludedTools: ["apply_diff", "write_to_file"], supportsImages: true, supportsPromptCache: true, supportsReasoningEffort: ["minimal", "low", "medium", "high"], @@ -116,6 +128,8 @@ export const openAiNativeModels = { maxTokens: 128000, contextWindow: 400000, supportsNativeTools: true, + includedTools: ["apply_patch"], + excludedTools: ["apply_diff", "write_to_file"], supportsImages: true, supportsPromptCache: true, supportsReasoningEffort: ["low", "medium", "high"], @@ -131,6 +145,8 @@ export const openAiNativeModels = { maxTokens: 128000, contextWindow: 400000, supportsNativeTools: true, + includedTools: ["apply_patch"], + excludedTools: ["apply_diff", "write_to_file"], supportsImages: true, supportsPromptCache: true, supportsReasoningEffort: ["minimal", "low", "medium", "high"], @@ -147,6 +163,8 @@ export const openAiNativeModels = { maxTokens: 128000, contextWindow: 400000, supportsNativeTools: true, + includedTools: ["apply_patch"], + excludedTools: ["apply_diff", "write_to_file"], supportsImages: true, supportsPromptCache: true, inputPrice: 1.25, @@ -158,6 +176,8 @@ export const openAiNativeModels = { maxTokens: 32_768, contextWindow: 1_047_576, supportsNativeTools: true, + includedTools: ["apply_patch"], + excludedTools: ["apply_diff", "write_to_file"], supportsImages: true, supportsPromptCache: true, inputPrice: 2, @@ -172,6 +192,8 @@ export const openAiNativeModels = { maxTokens: 32_768, contextWindow: 1_047_576, supportsNativeTools: true, + includedTools: ["apply_patch"], + excludedTools: ["apply_diff", "write_to_file"], supportsImages: true, supportsPromptCache: true, inputPrice: 0.4, @@ -186,6 +208,8 @@ export const openAiNativeModels = { maxTokens: 32_768, contextWindow: 1_047_576, supportsNativeTools: true, + includedTools: ["apply_patch"], + excludedTools: ["apply_diff", "write_to_file"], supportsImages: true, supportsPromptCache: true, inputPrice: 0.1, @@ -394,6 +418,8 @@ export const openAiNativeModels = { maxTokens: 128000, contextWindow: 400000, supportsNativeTools: true, + includedTools: ["apply_patch"], + excludedTools: ["apply_diff", "write_to_file"], supportsImages: true, supportsPromptCache: true, supportsReasoningEffort: ["minimal", "low", "medium", "high"], @@ -413,6 +439,8 @@ export const openAiNativeModels = { maxTokens: 128000, contextWindow: 400000, supportsNativeTools: true, + includedTools: ["apply_patch"], + excludedTools: ["apply_diff", "write_to_file"], supportsImages: true, supportsPromptCache: true, supportsReasoningEffort: ["minimal", "low", "medium", "high"], @@ -432,6 +460,8 @@ export const openAiNativeModels = { maxTokens: 128000, contextWindow: 400000, supportsNativeTools: true, + includedTools: ["apply_patch"], + excludedTools: ["apply_diff", "write_to_file"], supportsImages: true, supportsPromptCache: true, supportsReasoningEffort: ["minimal", "low", "medium", "high"],