feat: add GPT-5.1, GPT-5.2, and xhigh reasoning support for OpenAI models (#1508)

This commit is contained in:
Ben Vargas
2025-12-12 13:00:12 -07:00
committed by GitHub
parent 757a26e160
commit 69ac46351e
7 changed files with 138 additions and 52 deletions

View File

@@ -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.

View File

@@ -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: 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` - **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 - **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 - **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: The Codex CLI provider supports only models available through ChatGPT subscription:
| Model ID | Description | Max Input Tokens | Max Output Tokens | | Model ID | Description | Max Input Tokens | Max Output Tokens | Reasoning Efforts |
|----------|-------------|------------------|-------------------| |----------|-------------|------------------|-------------------|-------------------|
| `gpt-5` | Latest GPT-5 model | 272K | 128K | | `gpt-5` | Latest GPT-5 model | 272K | 128K | - |
| `gpt-5-codex` | GPT-5 optimized for agentic software engineering | 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. **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 ## Configuration
@@ -419,8 +424,8 @@ To verify or configure:
**Causes and Solutions**: **Causes and Solutions**:
1. **Using unsupported model**: 1. **Using unsupported model**:
- Only `gpt-5` and `gpt-5-codex` are available via Codex CLI - 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, use the standard `openai` provider - For other OpenAI models or `gpt-5.2-pro`, use the standard `openai` provider
2. **Subscription not active**: 2. **Subscription not active**:
- Verify your ChatGPT subscription is active - Verify your ChatGPT subscription is active
@@ -495,7 +500,7 @@ To verify or configure:
## Important Notes ## Important Notes
- **OAuth subscription required**: No API key needed for basic operation, but requires active ChatGPT subscription - **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) - **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` - **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 - **Codebase analysis**: Automatically enabled when using `codex-cli` provider

49
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{ {
"name": "task-master-ai", "name": "task-master-ai",
"version": "0.37.1", "version": "0.37.2-rc.0",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "task-master-ai", "name": "task-master-ai",
"version": "0.37.1", "version": "0.37.2-rc.0",
"license": "MIT WITH Commons-Clause", "license": "MIT WITH Commons-Clause",
"workspaces": [ "workspaces": [
"apps/*", "apps/*",
@@ -36,7 +36,7 @@
"@types/turndown": "^5.0.6", "@types/turndown": "^5.0.6",
"ai": "^5.0.51", "ai": "^5.0.51",
"ai-sdk-provider-claude-code": "^2.2.4", "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", "ai-sdk-provider-gemini-cli": "^1.4.0",
"ajv": "^8.17.1", "ajv": "^8.17.1",
"ajv-formats": "^3.0.1", "ajv-formats": "^3.0.1",
@@ -8221,9 +8221,9 @@
} }
}, },
"node_modules/@openai/codex": { "node_modules/@openai/codex": {
"version": "0.44.0", "version": "0.60.1",
"resolved": "https://registry.npmjs.org/@openai/codex/-/codex-0.44.0.tgz", "resolved": "https://registry.npmjs.org/@openai/codex/-/codex-0.60.1.tgz",
"integrity": "sha512-5QNxwcuNn1aZMIzBs9E//vVLLRTZ8jkJRZas2XJgYdBNiSSlGzIuOfPBPXPNiQ2hRPKVqI4/APWIck4jxhw2KA==", "integrity": "sha512-qKLPldoUdBviRBltPxYYqbpOmTpFcIgy3Hbehrcda7kMY7OcdruU3HaTfERXwOXXOl853v8s8hBBpOALLqUCgQ==",
"license": "Apache-2.0", "license": "Apache-2.0",
"optional": true, "optional": true,
"bin": { "bin": {
@@ -14825,9 +14825,9 @@
} }
}, },
"node_modules/ai-sdk-provider-codex-cli": { "node_modules/ai-sdk-provider-codex-cli": {
"version": "0.3.0", "version": "0.7.0",
"resolved": "https://registry.npmjs.org/ai-sdk-provider-codex-cli/-/ai-sdk-provider-codex-cli-0.3.0.tgz", "resolved": "https://registry.npmjs.org/ai-sdk-provider-codex-cli/-/ai-sdk-provider-codex-cli-0.7.0.tgz",
"integrity": "sha512-Qz3fQMC4XqTpvaTOk+Zu9I70lf1mq74komvkc8Vp4hwVOglrqZbGWWCniZ1/4v7m7SFEoG6xK6c8QgsSozLq6g==", "integrity": "sha512-00ftsOWFsYjQBdiw+vyVeO+3D7R2e111KSAj0M7jVyFLnyuzTJuDpPwhnoOVmAGLLUorz62MOkSRZWroWOZ8Ew==",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@ai-sdk/provider": "2.0.0", "@ai-sdk/provider": "2.0.0",
@@ -14838,7 +14838,7 @@
"node": ">=18" "node": ">=18"
}, },
"optionalDependencies": { "optionalDependencies": {
"@openai/codex": "^0.44.0" "@openai/codex": "^0.60.1"
}, },
"peerDependencies": { "peerDependencies": {
"zod": "^3.0.0 || ^4.0.0" "zod": "^3.0.0 || ^4.0.0"
@@ -25710,7 +25710,6 @@
"os": [ "os": [
"android" "android"
], ],
"peer": true,
"engines": { "engines": {
"node": ">= 12.0.0" "node": ">= 12.0.0"
}, },
@@ -25732,7 +25731,6 @@
"os": [ "os": [
"darwin" "darwin"
], ],
"peer": true,
"engines": { "engines": {
"node": ">= 12.0.0" "node": ">= 12.0.0"
}, },
@@ -25754,7 +25752,6 @@
"os": [ "os": [
"darwin" "darwin"
], ],
"peer": true,
"engines": { "engines": {
"node": ">= 12.0.0" "node": ">= 12.0.0"
}, },
@@ -25776,7 +25773,6 @@
"os": [ "os": [
"freebsd" "freebsd"
], ],
"peer": true,
"engines": { "engines": {
"node": ">= 12.0.0" "node": ">= 12.0.0"
}, },
@@ -25798,7 +25794,6 @@
"os": [ "os": [
"linux" "linux"
], ],
"peer": true,
"engines": { "engines": {
"node": ">= 12.0.0" "node": ">= 12.0.0"
}, },
@@ -25820,7 +25815,6 @@
"os": [ "os": [
"linux" "linux"
], ],
"peer": true,
"engines": { "engines": {
"node": ">= 12.0.0" "node": ">= 12.0.0"
}, },
@@ -25842,7 +25836,6 @@
"os": [ "os": [
"linux" "linux"
], ],
"peer": true,
"engines": { "engines": {
"node": ">= 12.0.0" "node": ">= 12.0.0"
}, },
@@ -25864,7 +25857,6 @@
"os": [ "os": [
"linux" "linux"
], ],
"peer": true,
"engines": { "engines": {
"node": ">= 12.0.0" "node": ">= 12.0.0"
}, },
@@ -25886,7 +25878,6 @@
"os": [ "os": [
"linux" "linux"
], ],
"peer": true,
"engines": { "engines": {
"node": ">= 12.0.0" "node": ">= 12.0.0"
}, },
@@ -25908,7 +25899,6 @@
"os": [ "os": [
"win32" "win32"
], ],
"peer": true,
"engines": { "engines": {
"node": ">= 12.0.0" "node": ">= 12.0.0"
}, },
@@ -25930,7 +25920,6 @@
"os": [ "os": [
"win32" "win32"
], ],
"peer": true,
"engines": { "engines": {
"node": ">= 12.0.0" "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": { "node_modules/walker": {
"version": "1.0.8", "version": "1.0.8",
"resolved": "https://registry.npmjs.org/walker/-/walker-1.0.8.tgz", "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.8.tgz",

View File

@@ -75,7 +75,7 @@
"@types/turndown": "^5.0.6", "@types/turndown": "^5.0.6",
"ai": "^5.0.51", "ai": "^5.0.51",
"ai-sdk-provider-claude-code": "^2.2.4", "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", "ai-sdk-provider-gemini-cli": "^1.4.0",
"ajv": "^8.17.1", "ajv": "^8.17.1",
"ajv-formats": "^3.0.1", "ajv-formats": "^3.0.1",

View File

@@ -438,7 +438,10 @@ function validateCodexCliSettings(settings) {
outputLastMessageFile: z.string().optional(), outputLastMessageFile: z.string().optional(),
env: z.record(z.string(), z.string()).optional(), env: z.record(z.string(), z.string()).optional(),
verbose: z.boolean().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 const CommandSpecificSchema = z

View File

@@ -150,6 +150,42 @@
"allowed_roles": ["main", "fallback", "research"], "allowed_roles": ["main", "fallback", "research"],
"max_tokens": 128000, "max_tokens": 128000,
"supported": true "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": [ "mcp": [
@@ -395,6 +431,54 @@
"max_tokens": 100000, "max_tokens": 100000,
"temperature": 1, "temperature": 1,
"supported": true "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": [ "google": [

View File

@@ -20,7 +20,13 @@ jest.unstable_mockModule('ai-sdk-provider-codex-cli', () => ({
// Mock config getters // Mock config getters
jest.unstable_mockModule('../../../scripts/modules/config-manager.js', () => ({ jest.unstable_mockModule('../../../scripts/modules/config-manager.js', () => ({
getCodexCliSettingsForCommand: jest.fn(() => ({ allowNpx: true })), 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 // Provide commonly imported getters to satisfy other module imports if any
getDebugFlag: jest.fn(() => false), getDebugFlag: jest.fn(() => false),
getLogLevel: jest.fn(() => 'info') getLogLevel: jest.fn(() => 'info')
@@ -62,7 +68,13 @@ describe('CodexCliProvider', () => {
it('sets provider name and supported models', () => { it('sets provider name and supported models', () => {
expect(provider.name).toBe('Codex CLI'); 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', () => { it('does not require API key', () => {