Skip to content

Commit efbf427

Browse files
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>
1 parent 1370cb0 commit efbf427

File tree

21 files changed

+63
-5
lines changed

21 files changed

+63
-5
lines changed

packages/types/src/model.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export type ReasoningEffortWithMinimal = z.infer<typeof reasoningEffortWithMinim
2222
* Extended Reasoning Effort (includes "none" and "minimal")
2323
* Note: "disable" is a UI/control value, not a value sent as effort
2424
*/
25-
export const reasoningEffortsExtended = ["none", "minimal", "low", "medium", "high"] as const
25+
export const reasoningEffortsExtended = ["none", "minimal", "low", "medium", "high", "xhigh"] as const
2626

2727
export const reasoningEffortExtendedSchema = z.enum(reasoningEffortsExtended)
2828

@@ -31,7 +31,7 @@ export type ReasoningEffortExtended = z.infer<typeof reasoningEffortExtendedSche
3131
/**
3232
* Reasoning Effort user setting (includes "disable")
3333
*/
34-
export const reasoningEffortSettingValues = ["disable", "none", "minimal", "low", "medium", "high"] as const
34+
export const reasoningEffortSettingValues = ["disable", "none", "minimal", "low", "medium", "high", "xhigh"] as const
3535
export const reasoningEffortSettingSchema = z.enum(reasoningEffortSettingValues)
3636

3737
/**
@@ -88,7 +88,7 @@ export const modelInfoSchema = z.object({
8888
defaultTemperature: z.number().optional(),
8989
requiredReasoningBudget: z.boolean().optional(),
9090
supportsReasoningEffort: z
91-
.union([z.boolean(), z.array(z.enum(["disable", "none", "minimal", "low", "medium", "high"]))])
91+
.union([z.boolean(), z.array(z.enum(["disable", "none", "minimal", "low", "medium", "high", "xhigh"]))])
9292
.optional(),
9393
requiredReasoningEffort: z.boolean().optional(),
9494
preserveReasoning: z.boolean().optional(),

packages/types/src/providers/openai.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export const openAiNativeModels = {
1515
supportsImages: true,
1616
supportsPromptCache: true,
1717
promptCacheRetention: "24h",
18-
supportsReasoningEffort: ["low", "medium", "high"],
18+
supportsReasoningEffort: ["low", "medium", "high", "xhigh"],
1919
reasoningEffort: "medium",
2020
inputPrice: 1.25,
2121
outputPrice: 10.0,

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

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,46 @@ describe("OpenAiNativeHandler", () => {
464464
)
465465
})
466466

467+
it("should support xhigh reasoning effort for GPT-5.1 Codex Max", async () => {
468+
// Mock fetch for Responses API
469+
const mockFetch = vitest.fn().mockResolvedValue({
470+
ok: true,
471+
body: new ReadableStream({
472+
start(controller) {
473+
controller.enqueue(
474+
new TextEncoder().encode(
475+
'data: {"type":"response.output_item.added","item":{"type":"text","text":"XHigh effort"}}\n\n',
476+
),
477+
)
478+
controller.enqueue(new TextEncoder().encode("data: [DONE]\n\n"))
479+
controller.close()
480+
},
481+
}),
482+
})
483+
global.fetch = mockFetch as any
484+
485+
// Mock SDK to fail
486+
mockResponsesCreate.mockRejectedValue(new Error("SDK not available"))
487+
488+
handler = new OpenAiNativeHandler({
489+
...mockOptions,
490+
apiModelId: "gpt-5.1-codex-max",
491+
reasoningEffort: "xhigh",
492+
})
493+
494+
const stream = handler.createMessage(systemPrompt, messages)
495+
for await (const _chunk of stream) {
496+
// drain
497+
}
498+
499+
expect(mockFetch).toHaveBeenCalledWith(
500+
"https://api.openai.com/v1/responses",
501+
expect.objectContaining({
502+
body: expect.stringContaining('"effort":"xhigh"'),
503+
}),
504+
)
505+
})
506+
467507
it("should omit reasoning when selection is 'disable'", async () => {
468508
// Mock fetch for Responses API
469509
const mockFetch = vitest.fn().mockResolvedValue({

webview-ui/src/i18n/locales/ca/settings.json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

webview-ui/src/i18n/locales/de/settings.json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

webview-ui/src/i18n/locales/en/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,8 @@
512512
"minimal": "Minimal (Fastest)",
513513
"low": "Low",
514514
"medium": "Medium",
515-
"high": "High"
515+
"high": "High",
516+
"xhigh": "Extra High"
516517
},
517518
"verbosity": {
518519
"label": "Output Verbosity",

webview-ui/src/i18n/locales/es/settings.json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

webview-ui/src/i18n/locales/fr/settings.json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

webview-ui/src/i18n/locales/hi/settings.json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

webview-ui/src/i18n/locales/id/settings.json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)