From 69ac46351eac8e1c3f58b203b2a618bf6114c000 Mon Sep 17 00:00:00 2001 From: Ben Vargas Date: Fri, 12 Dec 2025 13:00:12 -0700 Subject: [PATCH] feat: add GPT-5.1, GPT-5.2, and xhigh reasoning support for OpenAI models (#1508) --- .changeset/xhigh-reasoning-support.md | 11 +++ docs/providers/codex-cli.md | 23 ++++--- package-lock.json | 49 +++---------- package.json | 2 +- scripts/modules/config-manager.js | 5 +- scripts/modules/supported-models.json | 84 +++++++++++++++++++++++ tests/unit/ai-providers/codex-cli.test.js | 16 ++++- 7 files changed, 138 insertions(+), 52 deletions(-) create mode 100644 .changeset/xhigh-reasoning-support.md diff --git a/.changeset/xhigh-reasoning-support.md b/.changeset/xhigh-reasoning-support.md new file mode 100644 index 00000000..01bc0db9 --- /dev/null +++ b/.changeset/xhigh-reasoning-support.md @@ -0,0 +1,11 @@ +--- +"task-master-ai": minor +--- + +Added support for new OpenAI models with reasoning effort configuration: +- `gpt-5.1` (codex-cli & openai): supports none, low, medium, high reasoning +- `gpt-5.1-codex-max` (codex-cli & openai): supports none, low, medium, high, xhigh reasoning +- `gpt-5.2` (codex-cli & openai): supports none, low, medium, high, xhigh reasoning +- `gpt-5.2-pro` (openai only): supports medium, high, xhigh reasoning + +Updated ai-sdk-provider-codex-cli dependency to ^0.7.0. diff --git a/docs/providers/codex-cli.md b/docs/providers/codex-cli.md index d9a45f03..9a30429e 100644 --- a/docs/providers/codex-cli.md +++ b/docs/providers/codex-cli.md @@ -6,7 +6,7 @@ The `codex-cli` provider integrates Task Master with OpenAI's Codex CLI via the The primary benefits of using the `codex-cli` provider include: -- **Use Latest OpenAI Models**: Access to cutting-edge models like GPT-5 and GPT-5-Codex via ChatGPT subscription +- **Use Latest OpenAI Models**: Access to cutting-edge models like GPT-5, GPT-5.1, GPT-5.2, and GPT-5-Codex via ChatGPT subscription - **OAuth Authentication**: No API key management needed - authenticate once with `codex login` - **Built-in Tool Execution**: Native support for command execution, file changes, MCP tools, and web search - **Native JSON Schema Support**: Structured output generation without post-processing @@ -117,14 +117,19 @@ OPENAI_CODEX_API_KEY=sk-your-openai-api-key-here The Codex CLI provider supports only models available through ChatGPT subscription: -| Model ID | Description | Max Input Tokens | Max Output Tokens | -|----------|-------------|------------------|-------------------| -| `gpt-5` | Latest GPT-5 model | 272K | 128K | -| `gpt-5-codex` | GPT-5 optimized for agentic software engineering | 272K | 128K | +| Model ID | Description | Max Input Tokens | Max Output Tokens | Reasoning Efforts | +|----------|-------------|------------------|-------------------|-------------------| +| `gpt-5` | Latest GPT-5 model | 272K | 128K | - | +| `gpt-5-codex` | GPT-5 optimized for agentic software engineering | 272K | 128K | - | +| `gpt-5.1` | GPT-5.1 with optional reasoning | 272K | 128K | none, low, medium, high | +| `gpt-5.1-codex-max` | GPT-5.1 Codex Max with enhanced reasoning | 272K | 128K | none, low, medium, high, xhigh | +| `gpt-5.2` | Latest flagship model for coding and agentic tasks | 272K | 128K | none, low, medium, high, xhigh | **Note**: These models are only available via OAuth subscription through Codex CLI (ChatGPT Plus, Pro, Business, Edu, or Enterprise plans). For other OpenAI models, use the standard `openai` provider with an API key. -**Research Capabilities**: Both GPT-5 models support web search tools, making them suitable for the `research` role in addition to `main` and `fallback` roles. +**Research Capabilities**: All GPT-5 models support web search tools, making them suitable for the `research` role in addition to `main` and `fallback` roles. + +**Reasoning Effort**: The `gpt-5.1-codex-max` and `gpt-5.2` models support the `xhigh` reasoning effort level, which provides maximum reasoning capability for complex tasks. Configure via `reasoningEffort` in your codexCli settings. ## Configuration @@ -419,8 +424,8 @@ To verify or configure: **Causes and Solutions**: 1. **Using unsupported model**: - - Only `gpt-5` and `gpt-5-codex` are available via Codex CLI - - For other OpenAI models, use the standard `openai` provider + - Only GPT-5 family models (`gpt-5`, `gpt-5-codex`, `gpt-5.1`, `gpt-5.1-codex-max`, `gpt-5.2`) are available via Codex CLI + - For other OpenAI models or `gpt-5.2-pro`, use the standard `openai` provider 2. **Subscription not active**: - Verify your ChatGPT subscription is active @@ -495,7 +500,7 @@ To verify or configure: ## Important Notes - **OAuth subscription required**: No API key needed for basic operation, but requires active ChatGPT subscription -- **Limited model selection**: Only `gpt-5` and `gpt-5-codex` available via OAuth +- **Model selection**: GPT-5 family models available via OAuth (`gpt-5`, `gpt-5-codex`, `gpt-5.1`, `gpt-5.1-codex-max`, `gpt-5.2`) - **Pricing information**: Not available for OAuth models (shows as "Unknown" in cost calculations) - **No automatic dependency**: The `@openai/codex` package is not added to Task Master's dependencies - install it globally or enable `allowNpx` - **Codebase analysis**: Automatically enabled when using `codex-cli` provider diff --git a/package-lock.json b/package-lock.json index 7e000892..510767f4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "task-master-ai", - "version": "0.37.1", + "version": "0.37.2-rc.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "task-master-ai", - "version": "0.37.1", + "version": "0.37.2-rc.0", "license": "MIT WITH Commons-Clause", "workspaces": [ "apps/*", @@ -36,7 +36,7 @@ "@types/turndown": "^5.0.6", "ai": "^5.0.51", "ai-sdk-provider-claude-code": "^2.2.4", - "ai-sdk-provider-codex-cli": "^0.3.0", + "ai-sdk-provider-codex-cli": "^0.7.0", "ai-sdk-provider-gemini-cli": "^1.4.0", "ajv": "^8.17.1", "ajv-formats": "^3.0.1", @@ -8221,9 +8221,9 @@ } }, "node_modules/@openai/codex": { - "version": "0.44.0", - "resolved": "https://registry.npmjs.org/@openai/codex/-/codex-0.44.0.tgz", - "integrity": "sha512-5QNxwcuNn1aZMIzBs9E//vVLLRTZ8jkJRZas2XJgYdBNiSSlGzIuOfPBPXPNiQ2hRPKVqI4/APWIck4jxhw2KA==", + "version": "0.60.1", + "resolved": "https://registry.npmjs.org/@openai/codex/-/codex-0.60.1.tgz", + "integrity": "sha512-qKLPldoUdBviRBltPxYYqbpOmTpFcIgy3Hbehrcda7kMY7OcdruU3HaTfERXwOXXOl853v8s8hBBpOALLqUCgQ==", "license": "Apache-2.0", "optional": true, "bin": { @@ -14825,9 +14825,9 @@ } }, "node_modules/ai-sdk-provider-codex-cli": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/ai-sdk-provider-codex-cli/-/ai-sdk-provider-codex-cli-0.3.0.tgz", - "integrity": "sha512-Qz3fQMC4XqTpvaTOk+Zu9I70lf1mq74komvkc8Vp4hwVOglrqZbGWWCniZ1/4v7m7SFEoG6xK6c8QgsSozLq6g==", + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/ai-sdk-provider-codex-cli/-/ai-sdk-provider-codex-cli-0.7.0.tgz", + "integrity": "sha512-00ftsOWFsYjQBdiw+vyVeO+3D7R2e111KSAj0M7jVyFLnyuzTJuDpPwhnoOVmAGLLUorz62MOkSRZWroWOZ8Ew==", "license": "MIT", "dependencies": { "@ai-sdk/provider": "2.0.0", @@ -14838,7 +14838,7 @@ "node": ">=18" }, "optionalDependencies": { - "@openai/codex": "^0.44.0" + "@openai/codex": "^0.60.1" }, "peerDependencies": { "zod": "^3.0.0 || ^4.0.0" @@ -25710,7 +25710,6 @@ "os": [ "android" ], - "peer": true, "engines": { "node": ">= 12.0.0" }, @@ -25732,7 +25731,6 @@ "os": [ "darwin" ], - "peer": true, "engines": { "node": ">= 12.0.0" }, @@ -25754,7 +25752,6 @@ "os": [ "darwin" ], - "peer": true, "engines": { "node": ">= 12.0.0" }, @@ -25776,7 +25773,6 @@ "os": [ "freebsd" ], - "peer": true, "engines": { "node": ">= 12.0.0" }, @@ -25798,7 +25794,6 @@ "os": [ "linux" ], - "peer": true, "engines": { "node": ">= 12.0.0" }, @@ -25820,7 +25815,6 @@ "os": [ "linux" ], - "peer": true, "engines": { "node": ">= 12.0.0" }, @@ -25842,7 +25836,6 @@ "os": [ "linux" ], - "peer": true, "engines": { "node": ">= 12.0.0" }, @@ -25864,7 +25857,6 @@ "os": [ "linux" ], - "peer": true, "engines": { "node": ">= 12.0.0" }, @@ -25886,7 +25878,6 @@ "os": [ "linux" ], - "peer": true, "engines": { "node": ">= 12.0.0" }, @@ -25908,7 +25899,6 @@ "os": [ "win32" ], - "peer": true, "engines": { "node": ">= 12.0.0" }, @@ -25930,7 +25920,6 @@ "os": [ "win32" ], - "peer": true, "engines": { "node": ">= 12.0.0" }, @@ -35722,24 +35711,6 @@ } } }, - "node_modules/vitest/node_modules/yaml": { - "version": "2.8.2", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.2.tgz", - "integrity": "sha512-mplynKqc1C2hTVYxd0PU2xQAc22TI1vShAYGksCCfxbn/dFwnHTNi1bvYsBTkhdUNtGIf5xNOg938rrSSYvS9A==", - "dev": true, - "license": "ISC", - "optional": true, - "peer": true, - "bin": { - "yaml": "bin.mjs" - }, - "engines": { - "node": ">= 14.6" - }, - "funding": { - "url": "https://github.com/sponsors/eemeli" - } - }, "node_modules/walker": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.8.tgz", diff --git a/package.json b/package.json index f1de14e2..8286fbd1 100644 --- a/package.json +++ b/package.json @@ -75,7 +75,7 @@ "@types/turndown": "^5.0.6", "ai": "^5.0.51", "ai-sdk-provider-claude-code": "^2.2.4", - "ai-sdk-provider-codex-cli": "^0.3.0", + "ai-sdk-provider-codex-cli": "^0.7.0", "ai-sdk-provider-gemini-cli": "^1.4.0", "ajv": "^8.17.1", "ajv-formats": "^3.0.1", diff --git a/scripts/modules/config-manager.js b/scripts/modules/config-manager.js index 7be39da5..da044bae 100644 --- a/scripts/modules/config-manager.js +++ b/scripts/modules/config-manager.js @@ -438,7 +438,10 @@ function validateCodexCliSettings(settings) { outputLastMessageFile: z.string().optional(), env: z.record(z.string(), z.string()).optional(), verbose: z.boolean().optional(), - logger: z.union([z.object({}).passthrough(), z.literal(false)]).optional() + logger: z.union([z.object({}).passthrough(), z.literal(false)]).optional(), + reasoningEffort: z + .enum(['none', 'minimal', 'low', 'medium', 'high', 'xhigh']) + .optional() }); const CommandSpecificSchema = z diff --git a/scripts/modules/supported-models.json b/scripts/modules/supported-models.json index 26959d8e..f0a799c9 100644 --- a/scripts/modules/supported-models.json +++ b/scripts/modules/supported-models.json @@ -150,6 +150,42 @@ "allowed_roles": ["main", "fallback", "research"], "max_tokens": 128000, "supported": true + }, + { + "id": "gpt-5.1", + "swe_score": 0.76, + "cost_per_1m_tokens": { + "input": 0, + "output": 0 + }, + "allowed_roles": ["main", "fallback", "research"], + "max_tokens": 128000, + "reasoning_efforts": ["none", "low", "medium", "high"], + "supported": true + }, + { + "id": "gpt-5.1-codex-max", + "swe_score": 0.78, + "cost_per_1m_tokens": { + "input": 0, + "output": 0 + }, + "allowed_roles": ["main", "fallback", "research"], + "max_tokens": 128000, + "reasoning_efforts": ["none", "low", "medium", "high", "xhigh"], + "supported": true + }, + { + "id": "gpt-5.2", + "swe_score": 0.8, + "cost_per_1m_tokens": { + "input": 0, + "output": 0 + }, + "allowed_roles": ["main", "fallback", "research"], + "max_tokens": 128000, + "reasoning_efforts": ["none", "low", "medium", "high", "xhigh"], + "supported": true } ], "mcp": [ @@ -395,6 +431,54 @@ "max_tokens": 100000, "temperature": 1, "supported": true + }, + { + "id": "gpt-5.1", + "swe_score": 0.76, + "cost_per_1m_tokens": { + "input": 1.25, + "output": 10.0 + }, + "allowed_roles": ["main", "fallback"], + "max_tokens": 128000, + "reasoning_efforts": ["none", "low", "medium", "high"], + "supported": true + }, + { + "id": "gpt-5.1-codex-max", + "swe_score": 0.78, + "cost_per_1m_tokens": { + "input": 1.25, + "output": 10.0 + }, + "allowed_roles": ["main", "fallback"], + "max_tokens": 128000, + "reasoning_efforts": ["none", "low", "medium", "high", "xhigh"], + "supported": true + }, + { + "id": "gpt-5.2", + "swe_score": 0.8, + "cost_per_1m_tokens": { + "input": 1.75, + "output": 14.0 + }, + "allowed_roles": ["main", "fallback"], + "max_tokens": 128000, + "reasoning_efforts": ["none", "low", "medium", "high", "xhigh"], + "supported": true + }, + { + "id": "gpt-5.2-pro", + "swe_score": 0.82, + "cost_per_1m_tokens": { + "input": 21.0, + "output": 168.0 + }, + "allowed_roles": ["main", "fallback"], + "max_tokens": 128000, + "reasoning_efforts": ["medium", "high", "xhigh"], + "supported": true } ], "google": [ diff --git a/tests/unit/ai-providers/codex-cli.test.js b/tests/unit/ai-providers/codex-cli.test.js index adb5d065..5806299a 100644 --- a/tests/unit/ai-providers/codex-cli.test.js +++ b/tests/unit/ai-providers/codex-cli.test.js @@ -20,7 +20,13 @@ jest.unstable_mockModule('ai-sdk-provider-codex-cli', () => ({ // Mock config getters jest.unstable_mockModule('../../../scripts/modules/config-manager.js', () => ({ getCodexCliSettingsForCommand: jest.fn(() => ({ allowNpx: true })), - getSupportedModelsForProvider: jest.fn(() => ['gpt-5', 'gpt-5-codex']), + getSupportedModelsForProvider: jest.fn(() => [ + 'gpt-5', + 'gpt-5-codex', + 'gpt-5.1', + 'gpt-5.1-codex-max', + 'gpt-5.2' + ]), // Provide commonly imported getters to satisfy other module imports if any getDebugFlag: jest.fn(() => false), getLogLevel: jest.fn(() => 'info') @@ -62,7 +68,13 @@ describe('CodexCliProvider', () => { it('sets provider name and supported models', () => { expect(provider.name).toBe('Codex CLI'); - expect(provider.supportedModels).toEqual(['gpt-5', 'gpt-5-codex']); + expect(provider.supportedModels).toEqual([ + 'gpt-5', + 'gpt-5-codex', + 'gpt-5.1', + 'gpt-5.1-codex-max', + 'gpt-5.2' + ]); }); it('does not require API key', () => {