mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-07 08:26:51 +00:00
feat: add xhigh reasoning effort for gpt-5.1-codex-max (#9900)
* feat: add xhigh reasoning effort for gpt-5.1-codex-max * fix: Address openai-native.spec.ts test failure * chore: Localisation of 'Extra high' * chore: revert unrelated CustomModesManager refactoring --------- Co-authored-by: Hannes Rudolph <hrudolph@gmail.com>
This commit is contained in:
parent
1370cb04f7
commit
efbf427631
21 changed files with 63 additions and 5 deletions
|
|
@ -22,7 +22,7 @@ export type ReasoningEffortWithMinimal = z.infer<typeof reasoningEffortWithMinim
|
|||
* Extended Reasoning Effort (includes "none" and "minimal")
|
||||
* Note: "disable" is a UI/control value, not a value sent as effort
|
||||
*/
|
||||
export const reasoningEffortsExtended = ["none", "minimal", "low", "medium", "high"] as const
|
||||
export const reasoningEffortsExtended = ["none", "minimal", "low", "medium", "high", "xhigh"] as const
|
||||
|
||||
export const reasoningEffortExtendedSchema = z.enum(reasoningEffortsExtended)
|
||||
|
||||
|
|
@ -31,7 +31,7 @@ export type ReasoningEffortExtended = z.infer<typeof reasoningEffortExtendedSche
|
|||
/**
|
||||
* Reasoning Effort user setting (includes "disable")
|
||||
*/
|
||||
export const reasoningEffortSettingValues = ["disable", "none", "minimal", "low", "medium", "high"] as const
|
||||
export const reasoningEffortSettingValues = ["disable", "none", "minimal", "low", "medium", "high", "xhigh"] as const
|
||||
export const reasoningEffortSettingSchema = z.enum(reasoningEffortSettingValues)
|
||||
|
||||
/**
|
||||
|
|
@ -88,7 +88,7 @@ export const modelInfoSchema = z.object({
|
|||
defaultTemperature: z.number().optional(),
|
||||
requiredReasoningBudget: z.boolean().optional(),
|
||||
supportsReasoningEffort: z
|
||||
.union([z.boolean(), z.array(z.enum(["disable", "none", "minimal", "low", "medium", "high"]))])
|
||||
.union([z.boolean(), z.array(z.enum(["disable", "none", "minimal", "low", "medium", "high", "xhigh"]))])
|
||||
.optional(),
|
||||
requiredReasoningEffort: z.boolean().optional(),
|
||||
preserveReasoning: z.boolean().optional(),
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ export const openAiNativeModels = {
|
|||
supportsImages: true,
|
||||
supportsPromptCache: true,
|
||||
promptCacheRetention: "24h",
|
||||
supportsReasoningEffort: ["low", "medium", "high"],
|
||||
supportsReasoningEffort: ["low", "medium", "high", "xhigh"],
|
||||
reasoningEffort: "medium",
|
||||
inputPrice: 1.25,
|
||||
outputPrice: 10.0,
|
||||
|
|
|
|||
|
|
@ -464,6 +464,46 @@ describe("OpenAiNativeHandler", () => {
|
|||
)
|
||||
})
|
||||
|
||||
it("should support xhigh reasoning effort for GPT-5.1 Codex Max", async () => {
|
||||
// Mock fetch for Responses API
|
||||
const mockFetch = vitest.fn().mockResolvedValue({
|
||||
ok: true,
|
||||
body: new ReadableStream({
|
||||
start(controller) {
|
||||
controller.enqueue(
|
||||
new TextEncoder().encode(
|
||||
'data: {"type":"response.output_item.added","item":{"type":"text","text":"XHigh effort"}}\n\n',
|
||||
),
|
||||
)
|
||||
controller.enqueue(new TextEncoder().encode("data: [DONE]\n\n"))
|
||||
controller.close()
|
||||
},
|
||||
}),
|
||||
})
|
||||
global.fetch = mockFetch as any
|
||||
|
||||
// Mock SDK to fail
|
||||
mockResponsesCreate.mockRejectedValue(new Error("SDK not available"))
|
||||
|
||||
handler = new OpenAiNativeHandler({
|
||||
...mockOptions,
|
||||
apiModelId: "gpt-5.1-codex-max",
|
||||
reasoningEffort: "xhigh",
|
||||
})
|
||||
|
||||
const stream = handler.createMessage(systemPrompt, messages)
|
||||
for await (const _chunk of stream) {
|
||||
// drain
|
||||
}
|
||||
|
||||
expect(mockFetch).toHaveBeenCalledWith(
|
||||
"https://api.openai.com/v1/responses",
|
||||
expect.objectContaining({
|
||||
body: expect.stringContaining('"effort":"xhigh"'),
|
||||
}),
|
||||
)
|
||||
})
|
||||
|
||||
it("should omit reasoning when selection is 'disable'", async () => {
|
||||
// Mock fetch for Responses API
|
||||
const mockFetch = vitest.fn().mockResolvedValue({
|
||||
|
|
|
|||
1
webview-ui/src/i18n/locales/ca/settings.json
generated
1
webview-ui/src/i18n/locales/ca/settings.json
generated
|
|
@ -506,6 +506,7 @@
|
|||
"none": "Cap",
|
||||
"minimal": "Mínim (el més ràpid)",
|
||||
"high": "Alt",
|
||||
"xhigh": "Molt alt",
|
||||
"medium": "Mitjà",
|
||||
"low": "Baix"
|
||||
},
|
||||
|
|
|
|||
1
webview-ui/src/i18n/locales/de/settings.json
generated
1
webview-ui/src/i18n/locales/de/settings.json
generated
|
|
@ -506,6 +506,7 @@
|
|||
"none": "Keine",
|
||||
"minimal": "Minimal (schnellste)",
|
||||
"high": "Hoch",
|
||||
"xhigh": "Sehr hoch",
|
||||
"medium": "Mittel",
|
||||
"low": "Niedrig"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -512,7 +512,8 @@
|
|||
"minimal": "Minimal (Fastest)",
|
||||
"low": "Low",
|
||||
"medium": "Medium",
|
||||
"high": "High"
|
||||
"high": "High",
|
||||
"xhigh": "Extra High"
|
||||
},
|
||||
"verbosity": {
|
||||
"label": "Output Verbosity",
|
||||
|
|
|
|||
1
webview-ui/src/i18n/locales/es/settings.json
generated
1
webview-ui/src/i18n/locales/es/settings.json
generated
|
|
@ -506,6 +506,7 @@
|
|||
"none": "Ninguno",
|
||||
"minimal": "Mínimo (el más rápido)",
|
||||
"high": "Alto",
|
||||
"xhigh": "Muy alto",
|
||||
"medium": "Medio",
|
||||
"low": "Bajo"
|
||||
},
|
||||
|
|
|
|||
1
webview-ui/src/i18n/locales/fr/settings.json
generated
1
webview-ui/src/i18n/locales/fr/settings.json
generated
|
|
@ -506,6 +506,7 @@
|
|||
"none": "Aucun",
|
||||
"minimal": "Minimal (le plus rapide)",
|
||||
"high": "Élevé",
|
||||
"xhigh": "Très élevé",
|
||||
"medium": "Moyen",
|
||||
"low": "Faible"
|
||||
},
|
||||
|
|
|
|||
1
webview-ui/src/i18n/locales/hi/settings.json
generated
1
webview-ui/src/i18n/locales/hi/settings.json
generated
|
|
@ -506,6 +506,7 @@
|
|||
"none": "कोई नहीं",
|
||||
"minimal": "न्यूनतम (सबसे तेज़)",
|
||||
"high": "उच्च",
|
||||
"xhigh": "बहुत उच्च",
|
||||
"medium": "मध्यम",
|
||||
"low": "निम्न"
|
||||
},
|
||||
|
|
|
|||
1
webview-ui/src/i18n/locales/id/settings.json
generated
1
webview-ui/src/i18n/locales/id/settings.json
generated
|
|
@ -510,6 +510,7 @@
|
|||
"none": "Tidak Ada",
|
||||
"minimal": "Minimal (Tercepat)",
|
||||
"high": "Tinggi",
|
||||
"xhigh": "Sangat tinggi",
|
||||
"medium": "Sedang",
|
||||
"low": "Rendah"
|
||||
},
|
||||
|
|
|
|||
1
webview-ui/src/i18n/locales/it/settings.json
generated
1
webview-ui/src/i18n/locales/it/settings.json
generated
|
|
@ -506,6 +506,7 @@
|
|||
"none": "Nessuno",
|
||||
"minimal": "Minimo (più veloce)",
|
||||
"high": "Alto",
|
||||
"xhigh": "Molto alto",
|
||||
"medium": "Medio",
|
||||
"low": "Basso"
|
||||
},
|
||||
|
|
|
|||
1
webview-ui/src/i18n/locales/ja/settings.json
generated
1
webview-ui/src/i18n/locales/ja/settings.json
generated
|
|
@ -506,6 +506,7 @@
|
|||
"none": "なし",
|
||||
"minimal": "最小 (最速)",
|
||||
"high": "高",
|
||||
"xhigh": "非常に高い",
|
||||
"medium": "中",
|
||||
"low": "低"
|
||||
},
|
||||
|
|
|
|||
1
webview-ui/src/i18n/locales/ko/settings.json
generated
1
webview-ui/src/i18n/locales/ko/settings.json
generated
|
|
@ -506,6 +506,7 @@
|
|||
"none": "없음",
|
||||
"minimal": "최소 (가장 빠름)",
|
||||
"high": "높음",
|
||||
"xhigh": "매우 높음",
|
||||
"medium": "중간",
|
||||
"low": "낮음"
|
||||
},
|
||||
|
|
|
|||
1
webview-ui/src/i18n/locales/nl/settings.json
generated
1
webview-ui/src/i18n/locales/nl/settings.json
generated
|
|
@ -506,6 +506,7 @@
|
|||
"none": "Geen",
|
||||
"minimal": "Minimaal (Snelst)",
|
||||
"high": "Hoog",
|
||||
"xhigh": "Zeer hoog",
|
||||
"medium": "Middel",
|
||||
"low": "Laag"
|
||||
},
|
||||
|
|
|
|||
1
webview-ui/src/i18n/locales/pl/settings.json
generated
1
webview-ui/src/i18n/locales/pl/settings.json
generated
|
|
@ -506,6 +506,7 @@
|
|||
"none": "Brak",
|
||||
"minimal": "Minimalny (najszybszy)",
|
||||
"high": "Wysoki",
|
||||
"xhigh": "Bardzo wysoki",
|
||||
"medium": "Średni",
|
||||
"low": "Niski"
|
||||
},
|
||||
|
|
|
|||
1
webview-ui/src/i18n/locales/pt-BR/settings.json
generated
1
webview-ui/src/i18n/locales/pt-BR/settings.json
generated
|
|
@ -506,6 +506,7 @@
|
|||
"none": "Nenhum",
|
||||
"minimal": "Mínimo (mais rápido)",
|
||||
"high": "Alto",
|
||||
"xhigh": "Muito alto",
|
||||
"medium": "Médio",
|
||||
"low": "Baixo"
|
||||
},
|
||||
|
|
|
|||
1
webview-ui/src/i18n/locales/ru/settings.json
generated
1
webview-ui/src/i18n/locales/ru/settings.json
generated
|
|
@ -506,6 +506,7 @@
|
|||
"none": "Нет",
|
||||
"minimal": "Минимальный (самый быстрый)",
|
||||
"high": "Высокие",
|
||||
"xhigh": "Очень высокие",
|
||||
"medium": "Средние",
|
||||
"low": "Низкие"
|
||||
},
|
||||
|
|
|
|||
1
webview-ui/src/i18n/locales/tr/settings.json
generated
1
webview-ui/src/i18n/locales/tr/settings.json
generated
|
|
@ -506,6 +506,7 @@
|
|||
"none": "Yok",
|
||||
"minimal": "Minimal (en hızlı)",
|
||||
"high": "Yüksek",
|
||||
"xhigh": "Çok yüksek",
|
||||
"medium": "Orta",
|
||||
"low": "Düşük"
|
||||
},
|
||||
|
|
|
|||
1
webview-ui/src/i18n/locales/vi/settings.json
generated
1
webview-ui/src/i18n/locales/vi/settings.json
generated
|
|
@ -506,6 +506,7 @@
|
|||
"none": "Không",
|
||||
"minimal": "Tối thiểu (nhanh nhất)",
|
||||
"high": "Cao",
|
||||
"xhigh": "Rất cao",
|
||||
"medium": "Trung bình",
|
||||
"low": "Thấp"
|
||||
},
|
||||
|
|
|
|||
1
webview-ui/src/i18n/locales/zh-CN/settings.json
generated
1
webview-ui/src/i18n/locales/zh-CN/settings.json
generated
|
|
@ -506,6 +506,7 @@
|
|||
"none": "无",
|
||||
"minimal": "最小 (最快)",
|
||||
"high": "高",
|
||||
"xhigh": "超高",
|
||||
"medium": "中",
|
||||
"low": "低"
|
||||
},
|
||||
|
|
|
|||
1
webview-ui/src/i18n/locales/zh-TW/settings.json
generated
1
webview-ui/src/i18n/locales/zh-TW/settings.json
generated
|
|
@ -506,6 +506,7 @@
|
|||
"none": "無",
|
||||
"minimal": "最小 (最快)",
|
||||
"high": "高",
|
||||
"xhigh": "超高",
|
||||
"medium": "中",
|
||||
"low": "低"
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue