mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-10-04 02:33:34 +00:00
Merge c2d809b358 into 2bb826039b
This commit is contained in:
commit
f7a2b05e6c
2 changed files with 65 additions and 11 deletions
|
|
@ -202,6 +202,34 @@ export const openAiCodexModels = {
|
||||||
supportsTemperature: false,
|
supportsTemperature: false,
|
||||||
description: "GPT-5.4 Mini: Lower-cost GPT-5.4 model via ChatGPT subscription",
|
description: "GPT-5.4 Mini: Lower-cost GPT-5.4 model 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 coding model via ChatGPT subscription",
|
||||||
|
},
|
||||||
"gpt-5.2": {
|
"gpt-5.2": {
|
||||||
maxTokens: 128000,
|
maxTokens: 128000,
|
||||||
contextWindow: 400000,
|
contextWindow: 400000,
|
||||||
|
|
|
||||||
|
|
@ -3,18 +3,24 @@
|
||||||
import { OpenAiCodexHandler } from "../openai-codex"
|
import { OpenAiCodexHandler } from "../openai-codex"
|
||||||
|
|
||||||
describe("OpenAiCodexHandler.getModel", () => {
|
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"])(
|
it.each([
|
||||||
"should return specified model when a valid model id is provided: %s",
|
"gpt-5.1",
|
||||||
(apiModelId) => {
|
"gpt-5",
|
||||||
const handler = new OpenAiCodexHandler({ apiModelId })
|
"gpt-5.1-codex",
|
||||||
const model = handler.getModel()
|
"gpt-5-codex",
|
||||||
|
"gpt-5-codex-mini",
|
||||||
|
"gpt-5.3-codex-spark",
|
||||||
|
"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.id).toBe(apiModelId)
|
||||||
expect(model.info).toBeDefined()
|
expect(model.info).toBeDefined()
|
||||||
// Default reasoning effort for GPT-5 family
|
// Default reasoning effort for GPT-5 family
|
||||||
expect(model.info.reasoningEffort).toBe("medium")
|
expect(model.info.reasoningEffort).toBe("medium")
|
||||||
},
|
})
|
||||||
)
|
|
||||||
|
|
||||||
it("should fall back to default model when an invalid model id is provided", () => {
|
it("should fall back to default model when an invalid model id is provided", () => {
|
||||||
const handler = new OpenAiCodexHandler({ apiModelId: "not-a-real-model" })
|
const handler = new OpenAiCodexHandler({ apiModelId: "not-a-real-model" })
|
||||||
|
|
@ -34,6 +40,26 @@ describe("OpenAiCodexHandler.getModel", () => {
|
||||||
expect(model.info.supportsImages).toBe(false)
|
expect(model.info.supportsImages).toBe(false)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it("should use GPT-5.4 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 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)
|
||||||
|
})
|
||||||
|
|
||||||
it("should use GPT-5.4 Mini capabilities when selected", () => {
|
it("should use GPT-5.4 Mini capabilities when selected", () => {
|
||||||
const handler = new OpenAiCodexHandler({ apiModelId: "gpt-5.4-mini" })
|
const handler = new OpenAiCodexHandler({ apiModelId: "gpt-5.4-mini" })
|
||||||
const model = handler.getModel()
|
const model = handler.getModel()
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue