Skip to content
This repository was archived by the owner on May 15, 2026. It is now read-only.

Commit c2d809b

Browse files
committed
feat: add GPT-5.4 Codex Spark fast models for Codex provider
Add gpt-5.4-codex-spark and gpt-5.4-mini-codex-spark model variants to the OpenAI Codex provider, following the existing gpt-5.3-codex-spark pattern. These are fast, text-only coding models with 128k context and 8192 max output tokens, accessible via ChatGPT subscription. Closes #12112
1 parent 8b12f21 commit c2d809b

2 files changed

Lines changed: 66 additions & 12 deletions

File tree

packages/types/src/providers/openai-codex.ts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,34 @@ export const openAiCodexModels = {
202202
supportsTemperature: false,
203203
description: "GPT-5.4 Mini: Lower-cost GPT-5.4 model via ChatGPT subscription",
204204
},
205+
"gpt-5.4-codex-spark": {
206+
maxTokens: 8192,
207+
contextWindow: 128000,
208+
includedTools: ["apply_patch"],
209+
excludedTools: ["apply_diff", "write_to_file"],
210+
supportsImages: false,
211+
supportsPromptCache: true,
212+
supportsReasoningEffort: ["low", "medium", "high", "xhigh"],
213+
reasoningEffort: "medium",
214+
inputPrice: 0,
215+
outputPrice: 0,
216+
supportsTemperature: false,
217+
description: "GPT-5.4 Codex Spark: Fast, text-only coding model via ChatGPT subscription",
218+
},
219+
"gpt-5.4-mini-codex-spark": {
220+
maxTokens: 8192,
221+
contextWindow: 128000,
222+
includedTools: ["apply_patch"],
223+
excludedTools: ["apply_diff", "write_to_file"],
224+
supportsImages: false,
225+
supportsPromptCache: true,
226+
supportsReasoningEffort: ["low", "medium", "high", "xhigh"],
227+
reasoningEffort: "medium",
228+
inputPrice: 0,
229+
outputPrice: 0,
230+
supportsTemperature: false,
231+
description: "GPT-5.4 Mini Codex Spark: Fast, text-only coding model via ChatGPT subscription",
232+
},
205233
"gpt-5.2": {
206234
maxTokens: 128000,
207235
contextWindow: 400000,

src/api/providers/__tests__/openai-codex.spec.ts

Lines changed: 38 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,24 @@
33
import { OpenAiCodexHandler } from "../openai-codex"
44

55
describe("OpenAiCodexHandler.getModel", () => {
6-
it.each(["gpt-5.1", "gpt-5", "gpt-5.1-codex", "gpt-5-codex", "gpt-5-codex-mini", "gpt-5.3-codex-spark"])(
7-
"should return specified model when a valid model id is provided: %s",
8-
(apiModelId) => {
9-
const handler = new OpenAiCodexHandler({ apiModelId })
10-
const model = handler.getModel()
11-
12-
expect(model.id).toBe(apiModelId)
13-
expect(model.info).toBeDefined()
14-
// Default reasoning effort for GPT-5 family
15-
expect(model.info.reasoningEffort).toBe("medium")
16-
},
17-
)
6+
it.each([
7+
"gpt-5.1",
8+
"gpt-5",
9+
"gpt-5.1-codex",
10+
"gpt-5-codex",
11+
"gpt-5-codex-mini",
12+
"gpt-5.3-codex-spark",
13+
"gpt-5.4-codex-spark",
14+
"gpt-5.4-mini-codex-spark",
15+
])("should return specified model when a valid model id is provided: %s", (apiModelId) => {
16+
const handler = new OpenAiCodexHandler({ apiModelId })
17+
const model = handler.getModel()
18+
19+
expect(model.id).toBe(apiModelId)
20+
expect(model.info).toBeDefined()
21+
// Default reasoning effort for GPT-5 family
22+
expect(model.info.reasoningEffort).toBe("medium")
23+
})
1824

1925
it("should fall back to default model when an invalid model id is provided", () => {
2026
const handler = new OpenAiCodexHandler({ apiModelId: "not-a-real-model" })
@@ -34,6 +40,26 @@ describe("OpenAiCodexHandler.getModel", () => {
3440
expect(model.info.supportsImages).toBe(false)
3541
})
3642

43+
it("should use GPT-5.4 Spark-specific limits and capabilities", () => {
44+
const handler = new OpenAiCodexHandler({ apiModelId: "gpt-5.4-codex-spark" })
45+
const model = handler.getModel()
46+
47+
expect(model.id).toBe("gpt-5.4-codex-spark")
48+
expect(model.info.contextWindow).toBe(128000)
49+
expect(model.info.maxTokens).toBe(8192)
50+
expect(model.info.supportsImages).toBe(false)
51+
})
52+
53+
it("should use GPT-5.4 Mini Spark-specific limits and capabilities", () => {
54+
const handler = new OpenAiCodexHandler({ apiModelId: "gpt-5.4-mini-codex-spark" })
55+
const model = handler.getModel()
56+
57+
expect(model.id).toBe("gpt-5.4-mini-codex-spark")
58+
expect(model.info.contextWindow).toBe(128000)
59+
expect(model.info.maxTokens).toBe(8192)
60+
expect(model.info.supportsImages).toBe(false)
61+
})
62+
3763
it("should use GPT-5.4 Mini capabilities when selected", () => {
3864
const handler = new OpenAiCodexHandler({ apiModelId: "gpt-5.4-mini" })
3965
const model = handler.getModel()

0 commit comments

Comments
 (0)