Skip to content

Commit 699682e

Browse files
EurFeluxclaude
andauthored
feat: add GPT-5.4 support and auto-fallback for future GPT-5.x sub-versions (#13293)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 2fc940f commit 699682e

File tree

8 files changed

+282
-77
lines changed

8 files changed

+282
-77
lines changed

src/renderer/src/config/models/__tests__/openai.test.ts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,34 @@ describe('OpenAI Model Detection', () => {
8484
})
8585
})
8686

87+
describe('should return true for future GPT-5.x sub-versions', () => {
88+
it('returns true for GPT-5.4 models', () => {
89+
expect(isSupportNoneReasoningEffortModel(createModel({ id: 'gpt-5.4' }))).toBe(true)
90+
expect(isSupportNoneReasoningEffortModel(createModel({ id: 'gpt-5.4-mini' }))).toBe(true)
91+
})
92+
93+
it('returns false for future GPT-5.x pro/chat variants', () => {
94+
expect(isSupportNoneReasoningEffortModel(createModel({ id: 'gpt-5.4-pro' }))).toBe(false)
95+
expect(isSupportNoneReasoningEffortModel(createModel({ id: 'gpt-5.4-chat' }))).toBe(false)
96+
})
97+
98+
it('returns true for future GPT-5.x codex variants (5.3+)', () => {
99+
expect(isSupportNoneReasoningEffortModel(createModel({ id: 'gpt-5.3-codex' }))).toBe(true)
100+
expect(isSupportNoneReasoningEffortModel(createModel({ id: 'gpt-5.4-codex' }))).toBe(true)
101+
})
102+
})
103+
104+
describe('should return false for GPT-5.1/5.2 codex variants', () => {
105+
it('returns false for GPT-5.1 codex models', () => {
106+
expect(isSupportNoneReasoningEffortModel(createModel({ id: 'gpt-5.1-codex' }))).toBe(false)
107+
expect(isSupportNoneReasoningEffortModel(createModel({ id: 'gpt-5.1-codex-mini' }))).toBe(false)
108+
})
109+
110+
it('returns false for GPT-5.2 codex models', () => {
111+
expect(isSupportNoneReasoningEffortModel(createModel({ id: 'gpt-5.2-codex' }))).toBe(false)
112+
})
113+
})
114+
87115
describe('should return false for GPT-5 series (non-5.1/5.2)', () => {
88116
it('returns false for GPT-5 base model', () => {
89117
expect(isSupportNoneReasoningEffortModel(createModel({ id: 'gpt-5' }))).toBe(false)

src/renderer/src/config/models/__tests__/reasoning.test.ts

Lines changed: 56 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,16 @@ describe('GPT-5.1 Series Models', () => {
480480
it('should not support GPT-5.1 chat models', () => {
481481
expect(isSupportedReasoningEffortOpenAIModel(createModel({ id: 'gpt-5.1-chat' }))).toBe(false)
482482
})
483+
484+
it('should support future GPT-5.x sub-version models', () => {
485+
expect(isSupportedReasoningEffortOpenAIModel(createModel({ id: 'gpt-5.4' }))).toBe(true)
486+
expect(isSupportedReasoningEffortOpenAIModel(createModel({ id: 'gpt-5.4-mini' }))).toBe(true)
487+
expect(isSupportedReasoningEffortOpenAIModel(createModel({ id: 'gpt-5.9' }))).toBe(true)
488+
})
489+
490+
it('should not support future GPT-5.x chat models', () => {
491+
expect(isSupportedReasoningEffortOpenAIModel(createModel({ id: 'gpt-5.4-chat' }))).toBe(false)
492+
})
483493
})
484494

485495
describe('isOpenAIReasoningModel', () => {
@@ -630,9 +640,13 @@ describe('Thinking model classification', () => {
630640
})
631641

632642
describe('Reasoning option configuration', () => {
633-
it('allows GPT-5.1 series models to disable reasoning', () => {
643+
it('allows GPT-5.1 base models to disable reasoning', () => {
634644
expect(MODEL_SUPPORTED_OPTIONS.gpt5_1).toContain('none')
635-
expect(MODEL_SUPPORTED_OPTIONS.gpt5_1_codex).toContain('none')
645+
})
646+
647+
it('does not allow GPT-5.1 codex models to disable reasoning', () => {
648+
expect(MODEL_SUPPORTED_OPTIONS.gpt5_1_codex).not.toContain('none')
649+
expect(MODEL_SUPPORTED_OPTIONS.gpt5_1_codex_max).not.toContain('none')
636650
})
637651

638652
it('restricts GPT-5 Pro reasoning to high effort only', () => {
@@ -663,7 +677,46 @@ describe('getThinkModelType - Comprehensive Coverage', () => {
663677
})
664678
})
665679

666-
describe('GPT-5 series models', () => {
680+
describe('GPT-5.2 series models', () => {
681+
it('should return gpt5_2 for GPT-5.2 models', () => {
682+
expect(getThinkModelType(createModel({ id: 'gpt-5.2' }))).toBe('gpt5_2')
683+
expect(getThinkModelType(createModel({ id: 'gpt-5.2-preview' }))).toBe('gpt5_2')
684+
expect(getThinkModelType(createModel({ id: 'gpt-5.2-mini' }))).toBe('gpt5_2')
685+
})
686+
687+
it('should return gpt52pro for GPT-5.2 Pro models', () => {
688+
expect(getThinkModelType(createModel({ id: 'gpt-5.2-pro' }))).toBe('gpt52pro')
689+
expect(getThinkModelType(createModel({ id: 'gpt-5.2-pro-preview' }))).toBe('gpt52pro')
690+
})
691+
692+
it('should return gpt5_2_codex for GPT-5.2 codex models', () => {
693+
expect(getThinkModelType(createModel({ id: 'gpt-5.2-codex' }))).toBe('gpt5_2_codex')
694+
expect(getThinkModelType(createModel({ id: 'gpt-5.2-codex-mini' }))).toBe('gpt5_2_codex')
695+
})
696+
})
697+
698+
describe('GPT-5.x future sub-version fallback', () => {
699+
it('should return gpt5_2 for future GPT-5.x models', () => {
700+
expect(getThinkModelType(createModel({ id: 'gpt-5.3' }))).toBe('gpt5_2')
701+
expect(getThinkModelType(createModel({ id: 'gpt-5.4' }))).toBe('gpt5_2')
702+
expect(getThinkModelType(createModel({ id: 'gpt-5.4-mini' }))).toBe('gpt5_2')
703+
expect(getThinkModelType(createModel({ id: 'gpt-5.9' }))).toBe('gpt5_2')
704+
})
705+
706+
it('should return gpt5_2 for future GPT-5.x codex models (5.3+, supports none)', () => {
707+
expect(getThinkModelType(createModel({ id: 'gpt-5.3-codex' }))).toBe('gpt5_2')
708+
expect(getThinkModelType(createModel({ id: 'gpt-5.4-codex' }))).toBe('gpt5_2')
709+
})
710+
711+
it('should return gpt52pro for future GPT-5.x Pro models', () => {
712+
expect(getThinkModelType(createModel({ id: 'gpt-5.3-pro' }))).toBe('gpt52pro')
713+
expect(getThinkModelType(createModel({ id: 'gpt-5.4-pro' }))).toBe('gpt52pro')
714+
expect(getThinkModelType(createModel({ id: 'gpt-5.4-pro-preview' }))).toBe('gpt52pro')
715+
expect(getThinkModelType(createModel({ id: 'gpt-5.9-pro' }))).toBe('gpt52pro')
716+
})
717+
})
718+
719+
describe('GPT-5 base series models', () => {
667720
it('should return gpt5_codex for GPT-5 codex models', () => {
668721
expect(getThinkModelType(createModel({ id: 'gpt-5-codex' }))).toBe('gpt5_codex')
669722
expect(getThinkModelType(createModel({ id: 'gpt-5-codex-mini' }))).toBe('gpt5_codex')
@@ -1895,13 +1948,11 @@ describe('getModelSupportedReasoningEffortOptions', () => {
18951948
it('should return correct options for GPT-5.1 Codex models', () => {
18961949
expect(getModelSupportedReasoningEffortOptions(createModel({ id: 'gpt-5.1-codex' }))).toEqual([
18971950
'default',
1898-
'none',
18991951
'medium',
19001952
'high'
19011953
])
19021954
expect(getModelSupportedReasoningEffortOptions(createModel({ id: 'gpt-5.1-codex-mini' }))).toEqual([
19031955
'default',
1904-
'none',
19051956
'medium',
19061957
'high'
19071958
])

src/renderer/src/config/models/__tests__/utils.test.ts

Lines changed: 85 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import type { Model } from '@renderer/types'
33
import { beforeEach, describe, expect, it, vi } from 'vitest'
44

55
import {
6+
isGPT5FamilyModel,
67
isGPT5ProModel,
78
isGPT5SeriesModel,
89
isGPT5SeriesReasoningModel,
@@ -175,13 +176,46 @@ describe('model utils', () => {
175176
})
176177

177178
describe('GPT-5 family detection', () => {
179+
describe('isGPT5FamilyModel', () => {
180+
it('returns true for GPT-5 base models', () => {
181+
expect(isGPT5FamilyModel(createModel({ id: 'gpt-5' }))).toBe(true)
182+
expect(isGPT5FamilyModel(createModel({ id: 'gpt-5-preview' }))).toBe(true)
183+
expect(isGPT5FamilyModel(createModel({ id: 'gpt-5-pro' }))).toBe(true)
184+
expect(isGPT5FamilyModel(createModel({ id: 'gpt-5-chat' }))).toBe(true)
185+
})
186+
187+
it('returns true for GPT-5.x sub-version models', () => {
188+
expect(isGPT5FamilyModel(createModel({ id: 'gpt-5.1' }))).toBe(true)
189+
expect(isGPT5FamilyModel(createModel({ id: 'gpt-5.1-mini' }))).toBe(true)
190+
expect(isGPT5FamilyModel(createModel({ id: 'gpt-5.2-pro' }))).toBe(true)
191+
expect(isGPT5FamilyModel(createModel({ id: 'gpt-5.4' }))).toBe(true)
192+
})
193+
194+
it('returns false for non-GPT-5 models', () => {
195+
expect(isGPT5FamilyModel(createModel({ id: 'gpt-4o' }))).toBe(false)
196+
expect(isGPT5FamilyModel(createModel({ id: 'gpt-4.1' }))).toBe(false)
197+
expect(isGPT5FamilyModel(createModel({ id: 'claude-3.5' }))).toBe(false)
198+
expect(isGPT5FamilyModel(createModel({ id: 'o3-mini' }))).toBe(false)
199+
})
200+
})
201+
178202
describe('isGPT5SeriesModel', () => {
179-
it('returns true for GPT-5 models', () => {
203+
it('returns true for GPT-5 base models', () => {
204+
expect(isGPT5SeriesModel(createModel({ id: 'gpt-5' }))).toBe(true)
180205
expect(isGPT5SeriesModel(createModel({ id: 'gpt-5-preview' }))).toBe(true)
206+
expect(isGPT5SeriesModel(createModel({ id: 'gpt-5-pro' }))).toBe(true)
181207
})
182208

183-
it('returns false for GPT-5.1 models', () => {
209+
it('returns false for GPT-5.x sub-version models', () => {
184210
expect(isGPT5SeriesModel(createModel({ id: 'gpt-5.1-preview' }))).toBe(false)
211+
expect(isGPT5SeriesModel(createModel({ id: 'gpt-5.2' }))).toBe(false)
212+
expect(isGPT5SeriesModel(createModel({ id: 'gpt-5.4' }))).toBe(false)
213+
expect(isGPT5SeriesModel(createModel({ id: 'gpt-5.9-turbo' }))).toBe(false)
214+
})
215+
216+
it('returns false for non-GPT-5 models', () => {
217+
expect(isGPT5SeriesModel(createModel({ id: 'gpt-4o' }))).toBe(false)
218+
expect(isGPT5SeriesModel(createModel({ id: 'gpt-4.1' }))).toBe(false)
185219
})
186220
})
187221

@@ -217,33 +251,65 @@ describe('model utils', () => {
217251
expect(isSupportVerbosityModel(createModel({ id: 'gpt-5' }))).toBe(true)
218252
})
219253

220-
it('returns false for GPT-5 chat models', () => {
221-
expect(isSupportVerbosityModel(createModel({ id: 'gpt-5-chat' }))).toBe(false)
254+
it('returns true for GPT-5.x sub-version models', () => {
255+
expect(isSupportVerbosityModel(createModel({ id: 'gpt-5.1-preview' }))).toBe(true)
256+
expect(isSupportVerbosityModel(createModel({ id: 'gpt-5.2' }))).toBe(true)
257+
expect(isSupportVerbosityModel(createModel({ id: 'gpt-5.4' }))).toBe(true)
258+
})
259+
260+
it('returns true for GPT-5 chat and codex models (granular exclusion handled by validators)', () => {
261+
expect(isSupportVerbosityModel(createModel({ id: 'gpt-5-chat' }))).toBe(true)
262+
expect(isSupportVerbosityModel(createModel({ id: 'gpt-5.1-chat' }))).toBe(true)
263+
expect(isSupportVerbosityModel(createModel({ id: 'gpt-5.1-codex' }))).toBe(true)
222264
})
223265

224-
it('returns true for GPT-5.1 models', () => {
225-
expect(isSupportVerbosityModel(createModel({ id: 'gpt-5.1-preview' }))).toBe(true)
266+
it('returns false for non-GPT-5 models', () => {
267+
expect(isSupportVerbosityModel(createModel({ id: 'gpt-4o' }))).toBe(false)
226268
})
227269
})
228270

229271
describe('getModelSupportedVerbosity', () => {
230-
it('returns only "high" for GPT-5 Pro models', () => {
231-
expect(getModelSupportedVerbosity(createModel({ id: 'gpt-5-pro' }))).toEqual([undefined, null, 'high'])
232-
expect(getModelSupportedVerbosity(createModel({ id: 'gpt-5-pro-2025-10-06' }))).toEqual([
233-
undefined,
234-
null,
235-
'high'
236-
])
272+
const allLevels = [undefined, null, 'low', 'medium', 'high']
273+
const mediumOnly = [undefined, null, 'medium']
274+
275+
it('GPT-5 models', () => {
276+
expect(getModelSupportedVerbosity(createModel({ id: 'gpt-5' }))).toEqual(allLevels)
277+
expect(getModelSupportedVerbosity(createModel({ id: 'gpt-5-mini' }))).toEqual(allLevels)
278+
expect(getModelSupportedVerbosity(createModel({ id: 'gpt-5-nano' }))).toEqual(allLevels)
279+
expect(getModelSupportedVerbosity(createModel({ id: 'gpt-5-pro' }))).toEqual(allLevels)
280+
expect(getModelSupportedVerbosity(createModel({ id: 'gpt-5-chat' }))).toEqual(mediumOnly)
281+
})
282+
283+
it('GPT-5.1 models', () => {
284+
expect(getModelSupportedVerbosity(createModel({ id: 'gpt-5.1' }))).toEqual(allLevels)
285+
expect(getModelSupportedVerbosity(createModel({ id: 'gpt-5.1-chat-latest' }))).toEqual(mediumOnly)
286+
expect(getModelSupportedVerbosity(createModel({ id: 'gpt-5.1-codex' }))).toEqual(mediumOnly)
287+
expect(getModelSupportedVerbosity(createModel({ id: 'gpt-5.1-codex-mini' }))).toEqual(mediumOnly)
288+
expect(getModelSupportedVerbosity(createModel({ id: 'gpt-5.1-codex-max' }))).toEqual(mediumOnly)
289+
})
290+
291+
it('GPT-5.2 models', () => {
292+
expect(getModelSupportedVerbosity(createModel({ id: 'gpt-5.2' }))).toEqual(allLevels)
293+
expect(getModelSupportedVerbosity(createModel({ id: 'gpt-5.2-pro' }))).toEqual(allLevels)
294+
expect(getModelSupportedVerbosity(createModel({ id: 'gpt-5.2-codex' }))).toEqual(mediumOnly)
295+
expect(getModelSupportedVerbosity(createModel({ id: 'gpt-5.2-chat-latest' }))).toEqual(mediumOnly)
296+
})
297+
298+
it('GPT-5.3 models', () => {
299+
expect(getModelSupportedVerbosity(createModel({ id: 'gpt-5.3-codex' }))).toEqual(allLevels)
300+
expect(getModelSupportedVerbosity(createModel({ id: 'gpt-5.3-chat-latest' }))).toEqual(mediumOnly)
237301
})
238302

239-
it('returns all levels for non-Pro GPT-5 models', () => {
240-
const previewModel = createModel({ id: 'gpt-5-preview' })
241-
expect(getModelSupportedVerbosity(previewModel)).toEqual([undefined, null, 'low', 'medium', 'high'])
303+
it('GPT-5.4 models', () => {
304+
expect(getModelSupportedVerbosity(createModel({ id: 'gpt-5.4' }))).toEqual(allLevels)
305+
expect(getModelSupportedVerbosity(createModel({ id: 'gpt-5.4-pro' }))).toEqual(allLevels)
242306
})
243307

244-
it('returns all levels for GPT-5.1 models', () => {
245-
const gpt51Model = createModel({ id: 'gpt-5.1-preview' })
246-
expect(getModelSupportedVerbosity(gpt51Model)).toEqual([undefined, null, 'low', 'medium', 'high'])
308+
it('future GPT-5.5+ models fallback correctly', () => {
309+
expect(getModelSupportedVerbosity(createModel({ id: 'gpt-5.5' }))).toEqual(allLevels)
310+
expect(getModelSupportedVerbosity(createModel({ id: 'gpt-5.5-pro' }))).toEqual(allLevels)
311+
expect(getModelSupportedVerbosity(createModel({ id: 'gpt-5.5-codex' }))).toEqual(allLevels)
312+
expect(getModelSupportedVerbosity(createModel({ id: 'gpt-5.5-chat-latest' }))).toEqual(mediumOnly)
247313
})
248314

249315
it('returns only undefined for non-GPT-5 models', () => {

src/renderer/src/config/models/default.ts

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,6 @@ export const SYSTEM_MODELS: Record<SystemProviderId | 'defaultModel', Model[]> =
238238
group: 'llama'
239239
}
240240
],
241-
242241
burncloud: [
243242
{ id: 'claude-opus-4-5-20251101', provider: 'burncloud', name: 'Claude 4.5 Opus', group: 'Claude 4.5' },
244243
{ id: 'claude-sonnet-4-5-20250929', provider: 'burncloud', name: 'Claude 4.5 Sonnet', group: 'Claude 4.5' },
@@ -318,13 +317,15 @@ export const SYSTEM_MODELS: Record<SystemProviderId | 'defaultModel', Model[]> =
318317
],
319318
alayanew: [],
320319
openai: [
321-
{ id: 'gpt-5.1', provider: 'openai', name: ' GPT 5.1', group: 'GPT 5.1' },
322-
{ id: 'gpt-5', provider: 'openai', name: ' GPT 5', group: 'GPT 5' },
323-
{ id: 'gpt-5-mini', provider: 'openai', name: ' GPT 5 Mini', group: 'GPT 5' },
324-
{ id: 'gpt-5-nano', provider: 'openai', name: ' GPT 5 Nano', group: 'GPT 5' },
325-
{ id: 'gpt-5-pro', provider: 'openai', name: ' GPT 5 Pro', group: 'GPT 5' },
326-
{ id: 'gpt-5-chat', provider: 'openai', name: ' GPT 5 Chat', group: 'GPT 5' },
327-
{ id: 'gpt-image-1', provider: 'openai', name: ' GPT Image 1', group: 'GPT Image' }
320+
{ id: 'gpt-5.4', provider: 'openai', name: ' GPT 5.4', group: 'gpt-5.4' },
321+
{ id: 'gpt-5.4-pro', provider: 'openai', name: ' GPT 5.4 Pro', group: 'gpt-5.4' },
322+
{ id: 'gpt-5.2', provider: 'openai', name: ' GPT 5.2', group: 'gpt-5.2' },
323+
{ id: 'gpt-5.2-pro', provider: 'openai', name: ' GPT 5.2 Pro', group: 'gpt-5.2' },
324+
{ id: 'gpt-5.1', provider: 'openai', name: ' GPT 5.1', group: 'gpt-5.1' },
325+
{ id: 'gpt-5', provider: 'openai', name: ' GPT 5', group: 'gpt-5' },
326+
{ id: 'gpt-5-pro', provider: 'openai', name: ' GPT 5 Pro', group: 'gpt-5' },
327+
{ id: 'gpt-5-chat', provider: 'openai', name: ' GPT 5 Chat', group: 'gpt-5' },
328+
{ id: 'gpt-image-1', provider: 'openai', name: ' GPT Image 1', group: 'gpt-image' }
328329
],
329330
'azure-openai': [
330331
{

src/renderer/src/config/models/openai.ts

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,28 @@ export const isOpenAIOpenWeightModel = (model: Model) => {
5050
return modelId.includes('gpt-oss')
5151
}
5252

53+
/**
54+
* Checks if a model belongs to the GPT-5 base series (e.g. gpt-5, gpt-5-pro).
55+
* Uses negative lookahead to exclude sub-versions like gpt-5.1, gpt-5.2, etc.
56+
*/
5357
export const isGPT5SeriesModel = (model: Model) => {
5458
const modelId = getLowerBaseModelName(model.id)
55-
return modelId.includes('gpt-5') && !modelId.includes('gpt-5.1') && !modelId.includes('gpt-5.2')
59+
return /gpt-5(?!\.\d)/.test(modelId)
5660
}
5761

5862
export const isGPT5SeriesReasoningModel = (model: Model) => {
5963
const modelId = getLowerBaseModelName(model.id)
6064
return isGPT5SeriesModel(model) && !modelId.includes('chat')
6165
}
6266

67+
/**
68+
* Checks if a model belongs to the GPT-5 family (gpt-5, gpt-5.1, gpt-5.2, etc.).
69+
*/
70+
export const isGPT5FamilyModel = (model: Model) => {
71+
const modelId = getLowerBaseModelName(model.id)
72+
return modelId.includes('gpt-5')
73+
}
74+
6375
export const isGPT51SeriesModel = (model: Model) => {
6476
const modelId = getLowerBaseModelName(model.id)
6577
return modelId.includes('gpt-5.1')
@@ -70,18 +82,14 @@ export const isGPT52SeriesModel = (model: Model) => {
7082
return modelId.includes('gpt-5.2')
7183
}
7284

73-
export function isSupportVerbosityModel(model: Model): boolean {
74-
const modelId = getLowerBaseModelName(model.id)
75-
return (
76-
(isGPT5SeriesModel(model) || isGPT51SeriesModel(model) || isGPT52SeriesModel(model)) && !modelId.includes('chat')
77-
)
78-
}
85+
export const isSupportVerbosityModel = isGPT5FamilyModel
7986

8087
/**
8188
* Determines if a model supports the "none" reasoning effort parameter.
8289
*
83-
* This applies to GPT-5.1 and GPT-5.2 series reasoning models (non-chat, non-pro variants).
90+
* This applies to GPT-5.x sub-version models (non-chat, non-pro variants).
8491
* These models allow setting reasoning_effort to "none" to skip reasoning steps.
92+
* Codex variants are supported from GPT-5.3 onwards; GPT-5.1/5.2 codex models are excluded.
8593
*
8694
* @param model - The model to check
8795
* @returns true if the model supports "none" reasoning effort, false otherwise
@@ -91,17 +99,24 @@ export function isSupportVerbosityModel(model: Model): boolean {
9199
* // Returns true
92100
* isSupportNoneReasoningEffortModel({ id: 'gpt-5.1', provider: 'openai' })
93101
* isSupportNoneReasoningEffortModel({ id: 'gpt-5.2-mini', provider: 'openai' })
102+
* isSupportNoneReasoningEffortModel({ id: 'gpt-5.3-codex', provider: 'openai' })
94103
*
95104
* // Returns false
96105
* isSupportNoneReasoningEffortModel({ id: 'gpt-5.1-pro', provider: 'openai' })
97-
* isSupportNoneReasoningEffortModel({ id: 'gpt-5.1-chat', provider: 'openai' })
106+
* isSupportNoneReasoningEffortModel({ id: 'gpt-5.1-codex', provider: 'openai' })
98107
* isSupportNoneReasoningEffortModel({ id: 'gpt-5-pro', provider: 'openai' })
99108
* ```
100109
*/
101110
export function isSupportNoneReasoningEffortModel(model: Model): boolean {
102111
const modelId = getLowerBaseModelName(model.id)
112+
const isCodex = modelId.includes('codex')
113+
const isOldCodex = isCodex && (isGPT51SeriesModel(model) || isGPT52SeriesModel(model))
103114
return (
104-
(isGPT51SeriesModel(model) || isGPT52SeriesModel(model)) && !modelId.includes('chat') && !modelId.includes('pro')
115+
isGPT5FamilyModel(model) &&
116+
!isGPT5SeriesModel(model) &&
117+
!modelId.includes('chat') &&
118+
!modelId.includes('pro') &&
119+
!isOldCodex
105120
)
106121
}
107122

@@ -131,7 +146,7 @@ export function isSupportedReasoningEffortOpenAIModel(model: Model): boolean {
131146
modelId.includes('o3') ||
132147
modelId.includes('o4') ||
133148
modelId.includes('gpt-oss') ||
134-
((isGPT5SeriesModel(model) || isGPT51SeriesModel(model) || isGPT52SeriesModel(model)) && !modelId.includes('chat'))
149+
(isGPT5FamilyModel(model) && !modelId.includes('chat'))
135150
)
136151
}
137152

0 commit comments

Comments
 (0)