You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: AGENTS.md
+8-4Lines changed: 8 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ This file provides coding guidance for AI agents (including Claude Code, Codex,
4
4
5
5
## Overview
6
6
7
-
This is an **opencode plugin** that enables OAuth authentication with OpenAI's ChatGPT Plus/Pro Codex backend. It allows users to access `gpt-5.1-codex`, `gpt-5.1-codex-max`, `gpt-5.1-codex-mini`, and `gpt-5.1` models through their ChatGPT subscription instead of using OpenAI Platform API credits. Legacy GPT-5.0 models are automatically normalized to their GPT-5.1 equivalents.
7
+
This is an **opencode plugin** that enables OAuth authentication with OpenAI's ChatGPT Plus/Pro Codex backend. It allows users to access `gpt-5.2-codex`, `gpt-5.1-codex`, `gpt-5.1-codex-max`, `gpt-5.1-codex-mini`, `gpt-5.2`, and `gpt-5.1` models through their ChatGPT subscription instead of using OpenAI Platform API credits. Legacy GPT-5.0 models are automatically normalized to their GPT-5.1 equivalents.
8
8
9
9
**Key architecture principle**: 7-step fetch flow that intercepts opencode's OpenAI SDK requests, transforms them for the ChatGPT backend API, and handles OAuth token management.
10
10
@@ -41,7 +41,7 @@ The main entry point orchestrates a **7-step fetch flow**:
41
41
1.**Token Management**: Check token expiration, refresh if needed
42
42
2.**URL Rewriting**: Transform OpenAI Platform API URLs → ChatGPT backend API (`https://chatgpt.com/backend-api/codex/responses`)
43
43
3.**Request Transformation**:
44
-
- Normalize model names (all variants → `gpt-5.1`, `gpt-5.1-codex`, `gpt-5.1-codex-max`, `gpt-5.1-codex-mini`, `gpt-5`, `gpt-5-codex`, or `codex-mini-latest`)
44
+
- Normalize model names (all variants → `gpt-5.2`, `gpt-5.2-codex`, `gpt-5.1`, `gpt-5.1-codex`, `gpt-5.1-codex-max`, `gpt-5.1-codex-mini`, `gpt-5`, `gpt-5-codex`, or `codex-mini-latest`)
45
45
- Inject Codex system instructions from latest GitHub release
-`minimal` effort auto-normalized to `low` for Codex families and clamped to `medium` (or `high` when requested) for Codex Mini
111
+
-`minimal` effort auto-normalized to `low` for Codex families (including GPT-5.2 Codex) and clamped to `medium` (or `high` when requested) for Codex Mini
110
112
111
113
**5. Model-Specific Prompt Selection**:
112
114
- Different prompts for different model families (matching Codex CLI):
-`gpt-5.2-codex-xhigh` - Deep GPT 5.2 Codex long-horizon work
15
+
-**New model family prompt**: `gpt-5.2-codex_prompt.md` fetched from the latest Codex CLI release with its own cache file.
16
+
-**Test coverage**: Added unit tests for GPT 5.2 Codex normalization, family selection, and reasoning behavior.
17
+
18
+
### Changed
19
+
-**Prompt selection alignment**: GPT 5.2 general now uses `gpt_5_2_prompt.md` (Codex CLI parity).
20
+
-**Reasoning configuration**: GPT 5.2 Codex supports `xhigh` but does **not** support `"none"`; `"none"` auto-upgrades to `"low"` and `"minimal"` normalizes to `"low"`.
21
+
-**Config presets**: `config/full-opencode.json` now includes 22 pre-configured variants (adds GPT 5.2 Codex).
22
+
-**Docs**: Updated README/AGENTS/config docs to include GPT 5.2 Codex and new model family behavior.
23
+
5
24
## [4.1.1] - 2025-12-17
6
25
7
26
**Minor release**: "none" reasoning effort support, orphaned function_call_output fix, and HTML version update.
- ✅ **Configurable reasoning** - Control effort, summary verbosity, and text output
48
48
- ✅ **Usage-aware errors** - Shows clear guidance when ChatGPT subscription limits are reached
49
-
- ✅ **Type-safe & tested** - Strict TypeScript with 193 unit tests + 16 integration tests
49
+
- ✅ **Type-safe & tested** - Strict TypeScript with 200+ unit tests + integration tests
50
50
- ✅ **Modular architecture** - Easy to maintain and extend
51
51
52
52
## Installation
@@ -62,7 +62,7 @@ Follow me on [X @nummanthinks](https://x.com/nummanthinks) for future updates an
62
62
#### Recommended: Pin the Version
63
63
64
64
```json
65
-
"plugin": ["opencode-openai-codex-auth@4.1.1"]
65
+
"plugin": ["opencode-openai-codex-auth@4.2.0"]
66
66
```
67
67
68
68
**Why pin versions?** OpenCode uses Bun's lockfile which pins resolved versions. If you use `"opencode-openai-codex-auth"` without a version, it resolves to "latest" once and **never updates** even when new versions are published.
@@ -76,7 +76,7 @@ Simply change the version in your config and restart OpenCode:
76
76
"plugin": ["opencode-openai-codex-auth@3.3.0"]
77
77
78
78
// To:
79
-
"plugin": ["opencode-openai-codex-auth@4.1.1"]
79
+
"plugin": ["opencode-openai-codex-auth@4.2.0"]
80
80
```
81
81
82
82
OpenCode will detect the version mismatch and install the new version automatically.
|`gpt-5.1-medium`| GPT 5.1 Medium (OAuth) | Medium | Balanced general-purpose tasks |
256
263
|`gpt-5.1-high`| GPT 5.1 High (OAuth) | High | Deep reasoning, complex problems |
@@ -260,7 +267,7 @@ When using [`config/full-opencode.json`](./config/full-opencode.json), you get t
260
267
261
268
> **Note**: All `gpt-5.1-codex-mini*` presets map directly to the `gpt-5.1-codex-mini` slug with standard Codex limits (272k context / 128k output).
262
269
>
263
-
> **Note**: GPT 5.2and Codex Max both support `xhigh` reasoning. Use explicit reasoning levels (e.g., `gpt-5.2-high`, `gpt-5.1-codex-max-xhigh`) for precise control.
270
+
> **Note**: GPT 5.2, GPT 5.2 Codex, and Codex Max all support `xhigh` reasoning. Use explicit reasoning levels (e.g., `gpt-5.2-high`, `gpt-5.2-codex-xhigh`, `gpt-5.1-codex-max-xhigh`) for precise control.
264
271
265
272
> **⚠️ Important**: GPT 5 models can be temperamental - some variants may work better than others, some may give errors, and behavior may vary. Stick to the presets above configured in `full-opencode.json` for best results.
266
273
@@ -296,16 +303,16 @@ When no configuration is specified, the plugin uses these defaults for all GPT-5
0 commit comments