Skip to content

Commit c52583a

Browse files
steipetePeter Steinberger
andauthored
feat(openai): add GPT-5.6 series support (#98333)
* feat(openai): add GPT-5.6 series support * docs: refresh map for GPT-5.6 * fix(openai): preserve GPT-5.6 thinking metadata * fix(codex): sync managed app server version * fix(codex): sync managed app server version * fix(openai): account for GPT-5.6 cache writes --------- Co-authored-by: Peter Steinberger <[email protected]>
1 parent 2c7e989 commit c52583a

49 files changed

Lines changed: 1330 additions & 178 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎docs/docs_map.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7622,6 +7622,7 @@ Do not edit it by hand; run `pnpm docs:map:gen`.
76227622
- Headings:
76237623
- H2: Quick choice
76247624
- H2: Naming map
7625+
- H2: GPT-5.6 limited preview
76257626
- H2: OpenClaw feature coverage
76267627
- H2: Memory embeddings
76277628
- H2: Getting started

‎docs/plugins/codex-harness-reference.md‎

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -430,18 +430,25 @@ If discovery fails or times out, OpenClaw uses a bundled fallback catalog for:
430430

431431
- GPT-5.5
432432
- GPT-5.4 mini
433-
- GPT-5.2
434-
435-
The current bundled harness is `@openai/codex` `0.139.0`. A `model/list` probe
436-
against that bundled app-server returned:
437-
438-
| Model id | Default | Hidden | Input modalities | Reasoning efforts |
439-
| --------------- | ------- | ------ | ---------------- | ------------------------ |
440-
| `gpt-5.5` | Yes | No | text, image | low, medium, high, xhigh |
441-
| `gpt-5.4` | No | No | text, image | low, medium, high, xhigh |
442-
| `gpt-5.4-mini` | No | No | text, image | low, medium, high, xhigh |
443-
| `gpt-5.3-codex` | No | No | text, image | low, medium, high, xhigh |
444-
| `gpt-5.2` | No | No | text, image | low, medium, high, xhigh |
433+
434+
The current bundled harness is `@openai/codex` `0.142.4`. A `model/list` probe
435+
against that bundled app-server in a GPT-5.6-enabled workspace returned these
436+
public picker rows:
437+
438+
| Model id | Input modalities | Reasoning efforts |
439+
| --------------------- | ---------------- | ------------------------------------ |
440+
| `gpt-5.6-sol` | text, image | low, medium, high, xhigh, max, ultra |
441+
| `gpt-5.6-terra` | text, image | low, medium, high, xhigh, max, ultra |
442+
| `gpt-5.6-luna` | text, image | low, medium, high, xhigh, max |
443+
| `gpt-5.5` | text, image | low, medium, high, xhigh |
444+
| `gpt-5.4` | text, image | low, medium, high, xhigh |
445+
| `gpt-5.4-mini` | text, image | low, medium, high, xhigh |
446+
| `gpt-5.4-pro` | text, image | medium, high, xhigh |
447+
| `gpt-5.3-codex-spark` | text | low, medium, high, xhigh |
448+
449+
GPT-5.6 access is account-scoped during the limited preview. `max` is a model
450+
reasoning effort. `ultra` is separate Codex multi-agent orchestration metadata,
451+
not a standard OpenAI reasoning effort.
445452

446453
Hidden models can be returned by the app-server catalog for internal or
447454
specialized flows, but they are not normal model-picker choices.

‎docs/providers/openai.md‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ changing config.
3535
| Goal | Use | Notes |
3636
| ---------------------------------------------------- | -------------------------------------------------------- | --------------------------------------------------------------------- |
3737
| ChatGPT/Codex subscription with native Codex runtime | `openai/gpt-5.5` | Default OpenAI agent setup. Sign in with Codex auth. |
38+
| GPT-5.6 limited preview | `openai/gpt-5.6-sol`, `-terra`, or `-luna` | Requires an OpenAI-approved API organization or Codex workspace. |
3839
| Direct API-key billing for agent models | `openai/gpt-5.5` plus a Codex-compatible API-key profile | Use `auth.order.openai` to place the backup after subscription auth. |
3940
| Direct API-key billing through explicit OpenClaw | `openai/gpt-5.5` plus provider/model runtime `openclaw` | Select a normal `openai` API-key profile. |
4041
| Latest ChatGPT Instant API alias | `openai/chat-latest` | Direct API-key only. Moving alias for experiments, not the default. |
@@ -69,6 +70,25 @@ harness for OpenAI agent turns. Use OpenAI API-key profiles only when you want
6970
direct API-key auth for an OpenAI agent model.
7071
</Note>
7172

73+
## GPT-5.6 limited preview
74+
75+
OpenClaw recognizes the three public GPT-5.6 model ids:
76+
77+
- `openai/gpt-5.6-sol`
78+
- `openai/gpt-5.6-terra`
79+
- `openai/gpt-5.6-luna`
80+
81+
All three expose `max` reasoning in the current Codex app-server catalog. The
82+
OpenAI launch announcement describes Sol as the flagship tier, Terra as the
83+
balanced tier, and Luna as the fast, lower-cost tier. See the
84+
[GPT-5.6 launch announcement](https://openai.com/index/previewing-gpt-5-6-sol/)
85+
and [preview access guide](https://help.openai.com/en/articles/20001325-a-preview-of-gpt-5-6-sol-terra-and-luna).
86+
87+
Access is allowlisted during the preview and can be granted separately for the
88+
API and Codex. A paid ChatGPT plan alone does not grant access. OpenClaw keeps
89+
`openai/gpt-5.5` as the default; selecting a GPT-5.6 ref without access returns
90+
the upstream access error instead of falling back silently.
91+
7292
<Note>
7393
OpenAI agent model turns require the bundled Codex app-server plugin. Explicit
7494
OpenClaw runtime config remains available as an opt-in compatibility route. When OpenClaw is

‎docs/reference/prompt-caching.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ Per-agent heartbeat is supported at `agents.list[].heartbeat`.
107107
- OpenClaw uses `prompt_cache_key` to keep cache routing stable across turns. Direct OpenAI hosts use `prompt_cache_retention: "24h"` when `cacheRetention: "long"` is selected.
108108
- OpenAI-compatible Completions providers receive `prompt_cache_key` only when their model config explicitly sets `compat.supportsPromptCacheKey: true`. Long-retention forwarding is a separate capability: explicit `cacheRetention: "long"` sends `prompt_cache_retention: "24h"` only when that compat entry also supports long cache retention. Providers such as Mistral can opt into cache keys while setting `compat.supportsLongCacheRetention: false` to suppress the long-retention field. `cacheRetention: "none"` suppresses both fields.
109109
- OpenAI responses expose cached prompt tokens via `usage.prompt_tokens_details.cached_tokens` (or `input_tokens_details.cached_tokens` on Responses API events). OpenClaw maps that to `cacheRead`.
110-
- OpenAI does not expose a separate cache-write token counter, so `cacheWrite` stays `0` on OpenAI paths even when the provider is warming a cache.
110+
- GPT-5.6 Responses usage can also expose `input_tokens_details.cache_write_tokens`. OpenClaw maps that to `cacheWrite` and prices it at the model's cache-write rate; Responses that omit the field keep `cacheWrite` at `0`.
111111
- OpenAI returns useful tracing and rate-limit headers such as `x-request-id`, `openai-processing-ms`, and `x-ratelimit-*`, but cache-hit accounting should come from the usage payload, not from headers.
112112
- In practice, OpenAI often behaves like an initial-prefix cache rather than Anthropic-style moving full-history reuse. Stable long-prefix text turns can land near a `4864` cached-token plateau in current live probes, while tool-heavy or MCP-style transcripts often plateau near `4608` cached tokens even on exact repeats.
113113

@@ -335,7 +335,7 @@ Defaults:
335335
- Cache trace events are JSONL and include staged snapshots like `session:loaded`, `prompt:before`, `stream:context`, and `session:after`.
336336
- Per-turn cache token impact is visible in normal usage surfaces via `cacheRead` and `cacheWrite` (for example `/usage full` and session usage summaries).
337337
- For Anthropic, expect both `cacheRead` and `cacheWrite` when caching is active.
338-
- For OpenAI, expect `cacheRead` on cache hits and `cacheWrite` to remain `0`; OpenAI does not publish a separate cache-write token field.
338+
- For OpenAI, expect `cacheRead` on cache hits. GPT-5.6 Responses can also report `cacheWrite` while prompt segments are written; other Responses payloads that omit the write counter keep it at `0`.
339339
- If you need request tracing, log request IDs and rate-limit headers separately from cache metrics. OpenClaw's current cache-trace output is focused on prompt/session shape and normalized token usage rather than raw provider response headers.
340340

341341
## Quick troubleshooting

‎extensions/codex/npm-shrinkwrap.json‎

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

‎extensions/codex/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
},
99
"type": "module",
1010
"dependencies": {
11-
"@openai/codex": "0.139.0",
11+
"@openai/codex": "0.142.4",
1212
"typebox": "1.1.39",
1313
"ws": "8.21.0",
1414
"zod": "4.4.3"

‎extensions/codex/provider-catalog.ts‎

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,20 +46,29 @@ export function buildCodexModelDefinition(model: {
4646
model: string;
4747
displayName?: string;
4848
inputModalities: string[];
49-
supportedReasoningEfforts: string[];
49+
supportedReasoningEfforts?: string[];
5050
}): ModelDefinitionConfig {
5151
const id = model.id.trim() || model.model.trim();
52+
const supportedReasoningEfforts = model.supportedReasoningEfforts;
5253
return {
5354
id,
5455
name: model.displayName?.trim() || id,
5556
api: "openai-chatgpt-responses",
56-
reasoning: model.supportedReasoningEfforts.length > 0 || shouldDefaultToReasoningModel(id),
57+
reasoning:
58+
supportedReasoningEfforts !== undefined
59+
? supportedReasoningEfforts.length > 0
60+
: shouldDefaultToReasoningModel(id),
5761
input: model.inputModalities.includes("image") ? ["text", "image"] : ["text"],
5862
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
5963
contextWindow: DEFAULT_CONTEXT_WINDOW,
6064
maxTokens: DEFAULT_MAX_TOKENS,
6165
compat: {
62-
supportsReasoningEffort: model.supportedReasoningEfforts.length > 0,
66+
...(supportedReasoningEfforts !== undefined
67+
? { supportsReasoningEffort: supportedReasoningEfforts.length > 0 }
68+
: {}),
69+
...(supportedReasoningEfforts && supportedReasoningEfforts.length > 0
70+
? { supportedReasoningEfforts: [...supportedReasoningEfforts] }
71+
: {}),
6372
supportsUsageInStreaming: true,
6473
},
6574
};

‎extensions/codex/provider.test.ts‎

Lines changed: 55 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,11 @@ describe("codex provider", () => {
121121
name: "gpt-5.4",
122122
reasoning: true,
123123
input: ["text", "image"],
124-
compat: { supportsReasoningEffort: true, supportsUsageInStreaming: true },
124+
compat: {
125+
supportsReasoningEffort: true,
126+
supportedReasoningEfforts: ["low", "medium", "high", "xhigh"],
127+
supportsUsageInStreaming: true,
128+
},
125129
});
126130
});
127131

@@ -343,7 +347,9 @@ describe("codex provider", () => {
343347
expectRecordFields(model, {
344348
id: "o4-mini",
345349
reasoning: true,
346-
compat: { supportsReasoningEffort: true, supportsUsageInStreaming: true },
350+
compat: {
351+
supportsUsageInStreaming: true,
352+
},
347353
});
348354
expect(
349355
provider
@@ -352,6 +358,53 @@ describe("codex provider", () => {
352358
).toBe(true);
353359
});
354360

361+
it("keeps undiscovered GPT-5.6 models on family reasoning rules", () => {
362+
const provider = buildCodexProvider();
363+
const model = provider.resolveDynamicModel?.({
364+
provider: "codex",
365+
modelId: "gpt-5.6-luna",
366+
modelRegistry: { find: () => null },
367+
} as never);
368+
369+
expectRecordFields(model, {
370+
id: "gpt-5.6-luna",
371+
reasoning: true,
372+
compat: { supportsUsageInStreaming: true },
373+
});
374+
expect(
375+
provider
376+
.resolveThinkingProfile?.({ provider: "codex", modelId: "gpt-5.6-luna" } as never)
377+
?.levels.map((level) => level.id),
378+
).toContain("max");
379+
});
380+
381+
it("exposes max for the GPT-5.6 series", () => {
382+
const provider = buildCodexProvider();
383+
const levels = (modelId: string) =>
384+
provider
385+
.resolveThinkingProfile?.({ provider: "codex", modelId } as never)
386+
?.levels.map((level) => level.id);
387+
388+
expect(levels("gpt-5.6")).toContain("max");
389+
expect(levels("gpt-5.6-sol-oai")).toContain("max");
390+
expect(levels("gpt-5.6-terra")).toContain("max");
391+
expect(levels("gpt-5.6-luna")).toContain("max");
392+
});
393+
394+
it("uses app-server reasoning metadata as the authoritative thinking profile", () => {
395+
const provider = buildCodexProvider();
396+
397+
expect(
398+
provider
399+
.resolveThinkingProfile?.({
400+
provider: "codex",
401+
modelId: "gpt-5.4-pro",
402+
compat: { supportedReasoningEfforts: ["medium", "high", "xhigh"] },
403+
} as never)
404+
?.levels.map((level) => level.id),
405+
).toEqual(["off", "medium", "high", "xhigh"]);
406+
});
407+
355408
it("declares synthetic auth because the harness owns Codex credentials", () => {
356409
const provider = buildCodexProvider();
357410

0 commit comments

Comments
 (0)