mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-08-28 05:27:24 +00:00
feat: add GPT-5.4 Codex fast mode models (codex, spark variants)
Adds three new model entries to the OpenAI Codex provider: - gpt-5.4-codex: Full GPT-5.4 optimized for agentic coding (1M context) - gpt-5.4-codex-spark: Fast, text-only GPT-5.4 variant (128k context, 8k output) - gpt-5.4-mini-codex-spark: Fast, text-only GPT-5.4 Mini variant (128k context, 8k output) Follows the same pattern as existing gpt-5.3-codex and gpt-5.3-codex-spark models. Closes #12112
This commit is contained in:
parent
8b12f21439
commit
a583818ef5
2 changed files with 91 additions and 11 deletions
|
|
@ -172,6 +172,48 @@ export const openAiCodexModels = {
|
|||
supportsTemperature: false,
|
||||
description: "GPT-5.1 Codex Mini: Faster version for coding tasks via ChatGPT subscription",
|
||||
},
|
||||
"gpt-5.4-codex": {
|
||||
maxTokens: 128000,
|
||||
contextWindow: 1_050_000,
|
||||
includedTools: ["apply_patch"],
|
||||
excludedTools: ["apply_diff", "write_to_file"],
|
||||
supportsImages: true,
|
||||
supportsPromptCache: true,
|
||||
supportsReasoningEffort: ["low", "medium", "high", "xhigh"],
|
||||
reasoningEffort: "medium",
|
||||
inputPrice: 0,
|
||||
outputPrice: 0,
|
||||
supportsTemperature: false,
|
||||
description: "GPT-5.4 Codex: GPT-5.4 optimized for agentic coding via ChatGPT subscription",
|
||||
},
|
||||
"gpt-5.4-codex-spark": {
|
||||
maxTokens: 8192,
|
||||
contextWindow: 128000,
|
||||
includedTools: ["apply_patch"],
|
||||
excludedTools: ["apply_diff", "write_to_file"],
|
||||
supportsImages: false,
|
||||
supportsPromptCache: true,
|
||||
supportsReasoningEffort: ["low", "medium", "high", "xhigh"],
|
||||
reasoningEffort: "medium",
|
||||
inputPrice: 0,
|
||||
outputPrice: 0,
|
||||
supportsTemperature: false,
|
||||
description: "GPT-5.4 Codex Spark: Fast, text-only coding model via ChatGPT subscription",
|
||||
},
|
||||
"gpt-5.4-mini-codex-spark": {
|
||||
maxTokens: 8192,
|
||||
contextWindow: 128000,
|
||||
includedTools: ["apply_patch"],
|
||||
excludedTools: ["apply_diff", "write_to_file"],
|
||||
supportsImages: false,
|
||||
supportsPromptCache: true,
|
||||
supportsReasoningEffort: ["low", "medium", "high", "xhigh"],
|
||||
reasoningEffort: "medium",
|
||||
inputPrice: 0,
|
||||
outputPrice: 0,
|
||||
supportsTemperature: false,
|
||||
description: "GPT-5.4 Mini Codex Spark: Fast, text-only mini coding model via ChatGPT subscription",
|
||||
},
|
||||
"gpt-5.4": {
|
||||
maxTokens: 128000,
|
||||
contextWindow: 1_050_000,
|
||||
|
|
|
|||
|
|
@ -3,18 +3,25 @@
|
|||
import { OpenAiCodexHandler } from "../openai-codex"
|
||||
|
||||
describe("OpenAiCodexHandler.getModel", () => {
|
||||
it.each(["gpt-5.1", "gpt-5", "gpt-5.1-codex", "gpt-5-codex", "gpt-5-codex-mini", "gpt-5.3-codex-spark"])(
|
||||
"should return specified model when a valid model id is provided: %s",
|
||||
(apiModelId) => {
|
||||
const handler = new OpenAiCodexHandler({ apiModelId })
|
||||
const model = handler.getModel()
|
||||
it.each([
|
||||
"gpt-5.1",
|
||||
"gpt-5",
|
||||
"gpt-5.1-codex",
|
||||
"gpt-5-codex",
|
||||
"gpt-5-codex-mini",
|
||||
"gpt-5.3-codex-spark",
|
||||
"gpt-5.4-codex",
|
||||
"gpt-5.4-codex-spark",
|
||||
"gpt-5.4-mini-codex-spark",
|
||||
])("should return specified model when a valid model id is provided: %s", (apiModelId) => {
|
||||
const handler = new OpenAiCodexHandler({ apiModelId })
|
||||
const model = handler.getModel()
|
||||
|
||||
expect(model.id).toBe(apiModelId)
|
||||
expect(model.info).toBeDefined()
|
||||
// Default reasoning effort for GPT-5 family
|
||||
expect(model.info.reasoningEffort).toBe("medium")
|
||||
},
|
||||
)
|
||||
expect(model.id).toBe(apiModelId)
|
||||
expect(model.info).toBeDefined()
|
||||
// Default reasoning effort for GPT-5 family
|
||||
expect(model.info.reasoningEffort).toBe("medium")
|
||||
})
|
||||
|
||||
it("should fall back to default model when an invalid model id is provided", () => {
|
||||
const handler = new OpenAiCodexHandler({ apiModelId: "not-a-real-model" })
|
||||
|
|
@ -41,4 +48,35 @@ describe("OpenAiCodexHandler.getModel", () => {
|
|||
expect(model.id).toBe("gpt-5.4-mini")
|
||||
expect(model.info).toBeDefined()
|
||||
})
|
||||
|
||||
it("should use GPT-5.4 Codex capabilities when selected", () => {
|
||||
const handler = new OpenAiCodexHandler({ apiModelId: "gpt-5.4-codex" })
|
||||
const model = handler.getModel()
|
||||
|
||||
expect(model.id).toBe("gpt-5.4-codex")
|
||||
expect(model.info.contextWindow).toBe(1_050_000)
|
||||
expect(model.info.maxTokens).toBe(128000)
|
||||
expect(model.info.supportsImages).toBe(true)
|
||||
expect(model.info.reasoningEffort).toBe("medium")
|
||||
})
|
||||
|
||||
it("should use GPT-5.4 Codex Spark-specific limits and capabilities", () => {
|
||||
const handler = new OpenAiCodexHandler({ apiModelId: "gpt-5.4-codex-spark" })
|
||||
const model = handler.getModel()
|
||||
|
||||
expect(model.id).toBe("gpt-5.4-codex-spark")
|
||||
expect(model.info.contextWindow).toBe(128000)
|
||||
expect(model.info.maxTokens).toBe(8192)
|
||||
expect(model.info.supportsImages).toBe(false)
|
||||
})
|
||||
|
||||
it("should use GPT-5.4 Mini Codex Spark-specific limits and capabilities", () => {
|
||||
const handler = new OpenAiCodexHandler({ apiModelId: "gpt-5.4-mini-codex-spark" })
|
||||
const model = handler.getModel()
|
||||
|
||||
expect(model.id).toBe("gpt-5.4-mini-codex-spark")
|
||||
expect(model.info.contextWindow).toBe(128000)
|
||||
expect(model.info.maxTokens).toBe(8192)
|
||||
expect(model.info.supportsImages).toBe(false)
|
||||
})
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue