Skip to content

Commit 78d10cd

Browse files
Numman Aliclaude
authored andcommitted
feat: v4.1.0 - GPT 5.2 support and full image input capabilities
## Added - GPT 5.2 model family with 4 reasoning presets (low/medium/high/xhigh) - Full image input support for all 16 models via modalities config - GPT 5.2 model family in codex.ts with dedicated prompt handling ## Changed - Model ordering: GPT 5.2 → Codex Max → Codex → Codex Mini → GPT 5.1 - Removed default presets without explicit reasoning suffix - Updated @opencode-ai/plugin to ^1.0.150 (audit fix) - Test script now uses local dist and includes GPT 5.2 tests ## Tests - 193 unit tests + 16 integration tests (all passing) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
1 parent b51e9a9 commit 78d10cd

File tree

9 files changed

+272
-1007
lines changed

9 files changed

+272
-1007
lines changed

CHANGELOG.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,32 @@
22

33
All notable changes to this project are documented here. Dates use the ISO format (YYYY-MM-DD).
44

5+
## [4.1.0] - 2025-12-11
6+
7+
**Feature release**: GPT 5.2 model support and image input capabilities.
8+
9+
### Added
10+
- **GPT 5.2 model family support**: Full support for OpenAI's latest GPT 5.2 model with 4 reasoning level presets:
11+
- `gpt-5.2-low` - Fast responses with light reasoning
12+
- `gpt-5.2-medium` - Balanced reasoning for general tasks
13+
- `gpt-5.2-high` - Complex reasoning and analysis
14+
- `gpt-5.2-xhigh` - Deep multi-hour analysis (same as Codex Max)
15+
- **Full image input support**: All 16 model variants now include `modalities.input: ["text", "image"]` enabling full multimodal capabilities - read screenshots, diagrams, UI mockups, and any image directly in OpenCode.
16+
- **GPT 5.2 model family** added to `codex.ts` with dedicated prompt handling.
17+
- **Test coverage**: Updated integration tests to verify all 16 models (was 13), now 193 unit tests + 16 integration tests.
18+
19+
### Changed
20+
- **Model ordering**: Config now ordered by model family priority: GPT 5.2 → Codex Max → Codex → Codex Mini → GPT 5.1.
21+
- **Removed default presets**: Removed `gpt-5.1-codex-max` and `gpt-5.2` (without reasoning suffix) to enforce explicit reasoning level selection.
22+
- **Test script**: `scripts/test-all-models.sh` now uses local dist for testing and includes GPT 5.2 tests.
23+
- **Documentation**: Updated README with GPT 5.2 models, image support, and condensed config example.
24+
25+
### Technical Details
26+
- GPT 5.2 maps to `gpt-5.2` API model with same reasoning options as Codex Max (`low/medium/high/xhigh`).
27+
- `getModelFamily()` now returns `"gpt-5.2"` for GPT 5.2 models, using Codex Max prompts.
28+
- `getReasoningConfig()` treats GPT 5.2 like Codex Max for `xhigh` reasoning support.
29+
- Model normalization pattern matching updated to recognize GPT 5.2 before other patterns.
30+
531
## [4.0.2] - 2025-11-27
632

733
**Bugfix release**: Fixes compaction context loss, agent creation, and SSE/JSON response handling.

README.md

Lines changed: 51 additions & 224 deletions
Large diffs are not rendered by default.

config/full-opencode.json

Lines changed: 123 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "https://opencode.ai/config.json",
33
"plugin": [
4-
"opencode-openai-codex-auth@4.0.2"
4+
"opencode-openai-codex-auth@4.1.0"
55
],
66
"provider": {
77
"openai": {
@@ -15,12 +15,16 @@
1515
"store": false
1616
},
1717
"models": {
18-
"gpt-5.1-codex-low": {
19-
"name": "GPT 5.1 Codex Low (OAuth)",
18+
"gpt-5.2-low": {
19+
"name": "GPT 5.2 Low (OAuth)",
2020
"limit": {
2121
"context": 272000,
2222
"output": 128000
2323
},
24+
"modalities": {
25+
"input": ["text", "image"],
26+
"output": ["text"]
27+
},
2428
"options": {
2529
"reasoningEffort": "low",
2630
"reasoningSummary": "auto",
@@ -31,12 +35,16 @@
3135
"store": false
3236
}
3337
},
34-
"gpt-5.1-codex-medium": {
35-
"name": "GPT 5.1 Codex Medium (OAuth)",
38+
"gpt-5.2-medium": {
39+
"name": "GPT 5.2 Medium (OAuth)",
3640
"limit": {
3741
"context": 272000,
3842
"output": 128000
3943
},
44+
"modalities": {
45+
"input": ["text", "image"],
46+
"output": ["text"]
47+
},
4048
"options": {
4149
"reasoningEffort": "medium",
4250
"reasoningSummary": "auto",
@@ -47,12 +55,16 @@
4755
"store": false
4856
}
4957
},
50-
"gpt-5.1-codex-high": {
51-
"name": "GPT 5.1 Codex High (OAuth)",
58+
"gpt-5.2-high": {
59+
"name": "GPT 5.2 High (OAuth)",
5260
"limit": {
5361
"context": 272000,
5462
"output": 128000
5563
},
64+
"modalities": {
65+
"input": ["text", "image"],
66+
"output": ["text"]
67+
},
5668
"options": {
5769
"reasoningEffort": "high",
5870
"reasoningSummary": "detailed",
@@ -63,14 +75,18 @@
6375
"store": false
6476
}
6577
},
66-
"gpt-5.1-codex-max": {
67-
"name": "GPT 5.1 Codex Max (OAuth)",
78+
"gpt-5.2-xhigh": {
79+
"name": "GPT 5.2 Extra High (OAuth)",
6880
"limit": {
6981
"context": 272000,
7082
"output": 128000
7183
},
84+
"modalities": {
85+
"input": ["text", "image"],
86+
"output": ["text"]
87+
},
7288
"options": {
73-
"reasoningEffort": "high",
89+
"reasoningEffort": "xhigh",
7490
"reasoningSummary": "detailed",
7591
"textVerbosity": "medium",
7692
"include": [
@@ -85,6 +101,10 @@
85101
"context": 272000,
86102
"output": 128000
87103
},
104+
"modalities": {
105+
"input": ["text", "image"],
106+
"output": ["text"]
107+
},
88108
"options": {
89109
"reasoningEffort": "low",
90110
"reasoningSummary": "detailed",
@@ -101,6 +121,10 @@
101121
"context": 272000,
102122
"output": 128000
103123
},
124+
"modalities": {
125+
"input": ["text", "image"],
126+
"output": ["text"]
127+
},
104128
"options": {
105129
"reasoningEffort": "medium",
106130
"reasoningSummary": "detailed",
@@ -117,6 +141,10 @@
117141
"context": 272000,
118142
"output": 128000
119143
},
144+
"modalities": {
145+
"input": ["text", "image"],
146+
"output": ["text"]
147+
},
120148
"options": {
121149
"reasoningEffort": "high",
122150
"reasoningSummary": "detailed",
@@ -133,6 +161,10 @@
133161
"context": 272000,
134162
"output": 128000
135163
},
164+
"modalities": {
165+
"input": ["text", "image"],
166+
"output": ["text"]
167+
},
136168
"options": {
137169
"reasoningEffort": "xhigh",
138170
"reasoningSummary": "detailed",
@@ -143,12 +175,76 @@
143175
"store": false
144176
}
145177
},
178+
"gpt-5.1-codex-low": {
179+
"name": "GPT 5.1 Codex Low (OAuth)",
180+
"limit": {
181+
"context": 272000,
182+
"output": 128000
183+
},
184+
"modalities": {
185+
"input": ["text", "image"],
186+
"output": ["text"]
187+
},
188+
"options": {
189+
"reasoningEffort": "low",
190+
"reasoningSummary": "auto",
191+
"textVerbosity": "medium",
192+
"include": [
193+
"reasoning.encrypted_content"
194+
],
195+
"store": false
196+
}
197+
},
198+
"gpt-5.1-codex-medium": {
199+
"name": "GPT 5.1 Codex Medium (OAuth)",
200+
"limit": {
201+
"context": 272000,
202+
"output": 128000
203+
},
204+
"modalities": {
205+
"input": ["text", "image"],
206+
"output": ["text"]
207+
},
208+
"options": {
209+
"reasoningEffort": "medium",
210+
"reasoningSummary": "auto",
211+
"textVerbosity": "medium",
212+
"include": [
213+
"reasoning.encrypted_content"
214+
],
215+
"store": false
216+
}
217+
},
218+
"gpt-5.1-codex-high": {
219+
"name": "GPT 5.1 Codex High (OAuth)",
220+
"limit": {
221+
"context": 272000,
222+
"output": 128000
223+
},
224+
"modalities": {
225+
"input": ["text", "image"],
226+
"output": ["text"]
227+
},
228+
"options": {
229+
"reasoningEffort": "high",
230+
"reasoningSummary": "detailed",
231+
"textVerbosity": "medium",
232+
"include": [
233+
"reasoning.encrypted_content"
234+
],
235+
"store": false
236+
}
237+
},
146238
"gpt-5.1-codex-mini-medium": {
147239
"name": "GPT 5.1 Codex Mini Medium (OAuth)",
148240
"limit": {
149241
"context": 272000,
150242
"output": 128000
151243
},
244+
"modalities": {
245+
"input": ["text", "image"],
246+
"output": ["text"]
247+
},
152248
"options": {
153249
"reasoningEffort": "medium",
154250
"reasoningSummary": "auto",
@@ -165,6 +261,10 @@
165261
"context": 272000,
166262
"output": 128000
167263
},
264+
"modalities": {
265+
"input": ["text", "image"],
266+
"output": ["text"]
267+
},
168268
"options": {
169269
"reasoningEffort": "high",
170270
"reasoningSummary": "detailed",
@@ -181,6 +281,10 @@
181281
"context": 272000,
182282
"output": 128000
183283
},
284+
"modalities": {
285+
"input": ["text", "image"],
286+
"output": ["text"]
287+
},
184288
"options": {
185289
"reasoningEffort": "low",
186290
"reasoningSummary": "auto",
@@ -197,6 +301,10 @@
197301
"context": 272000,
198302
"output": 128000
199303
},
304+
"modalities": {
305+
"input": ["text", "image"],
306+
"output": ["text"]
307+
},
200308
"options": {
201309
"reasoningEffort": "medium",
202310
"reasoningSummary": "auto",
@@ -213,6 +321,10 @@
213321
"context": 272000,
214322
"output": 128000
215323
},
324+
"modalities": {
325+
"input": ["text", "image"],
326+
"output": ["text"]
327+
},
216328
"options": {
217329
"reasoningEffort": "high",
218330
"reasoningSummary": "detailed",
@@ -226,4 +338,4 @@
226338
}
227339
}
228340
}
229-
}
341+
}

lib/prompts/codex.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const __dirname = dirname(__filename);
1717
* Model family type for prompt selection
1818
* Maps to different system prompts in the Codex CLI
1919
*/
20-
export type ModelFamily = "codex-max" | "codex" | "gpt-5.1";
20+
export type ModelFamily = "codex-max" | "codex" | "gpt-5.2" | "gpt-5.1";
2121

2222
/**
2323
* Prompt file mapping for each model family
@@ -26,6 +26,7 @@ export type ModelFamily = "codex-max" | "codex" | "gpt-5.1";
2626
const PROMPT_FILES: Record<ModelFamily, string> = {
2727
"codex-max": "gpt-5.1-codex-max_prompt.md",
2828
codex: "gpt_5_codex_prompt.md",
29+
"gpt-5.2": "gpt-5.1-codex-max_prompt.md", // GPT 5.2 uses same prompts as codex-max
2930
"gpt-5.1": "gpt_5_1_prompt.md",
3031
};
3132

@@ -35,6 +36,7 @@ const PROMPT_FILES: Record<ModelFamily, string> = {
3536
const CACHE_FILES: Record<ModelFamily, string> = {
3637
"codex-max": "codex-max-instructions.md",
3738
codex: "codex-instructions.md",
39+
"gpt-5.2": "gpt-5.2-instructions.md",
3840
"gpt-5.1": "gpt-5.1-instructions.md",
3941
};
4042

@@ -54,6 +56,9 @@ export function getModelFamily(normalizedModel: string): ModelFamily {
5456
) {
5557
return "codex";
5658
}
59+
if (normalizedModel.includes("gpt-5.2")) {
60+
return "gpt-5.2";
61+
}
5762
return "gpt-5.1";
5863
}
5964

lib/request/helpers/model-map.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,15 @@ export const MODEL_MAP: Record<string, string> = {
2929
"gpt-5.1-codex-max-high": "gpt-5.1-codex-max",
3030
"gpt-5.1-codex-max-xhigh": "gpt-5.1-codex-max",
3131

32+
// ============================================================================
33+
// GPT-5.2 Models (same reasoning support as Codex Max: low/medium/high/xhigh)
34+
// ============================================================================
35+
"gpt-5.2": "gpt-5.2",
36+
"gpt-5.2-low": "gpt-5.2",
37+
"gpt-5.2-medium": "gpt-5.2",
38+
"gpt-5.2-high": "gpt-5.2",
39+
"gpt-5.2-xhigh": "gpt-5.2",
40+
3241
// ============================================================================
3342
// GPT-5.1 Codex Mini Models
3443
// ============================================================================

0 commit comments

Comments
 (0)