Skip to content

Commit 2f3221d

Browse files
committed
Merge pull request #1593 from olddonkey/codex/grok-46-xhigh-reasoning
2 parents 6ecfb5f + f813db1 commit 2f3221d

11 files changed

Lines changed: 130 additions & 9 deletions

File tree

‎docs-site/src/content/docs/guides/codex-app-models.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ metadata instead of an older-template approximation.
105105
| OpenAI (API key) | Exactly eight namespaced rows: `gpt-5.5`, `gpt-5.6`, Sol/Terra/Luna, and the three `*-pro` virtual ids (1,050,000 context; 922,000 max input for all eight) |
106106
| OpenRouter | `openrouter/openai/gpt-5.6-sol`, `openrouter/openai/gpt-5.6-terra`, `openrouter/openai/gpt-5.6-luna` (1,050,000) |
107107
| Cursor | Static fallback includes `cursor/gpt-5.6-sol`, `cursor/gpt-5.6-terra`, and `cursor/gpt-5.6-luna` (1,000,000), plus `cursor/grok-4.5` and `cursor/grok-4.5-fast` (500,000); live account discovery decides which remain visible. |
108-
| xAI | Live discovery is authoritative; the fallback catalog defaults to `xai/grok-4.5` with a 500,000-token window and `low` / `medium` / `high` reasoning controls. |
108+
| xAI | Live discovery is authoritative. The fallback catalog includes `xai/grok-4.6` and defaults to `xai/grok-4.5`; both have 500,000-token windows. Grok 4.6 exposes `low` / `medium` / `high` / `xhigh` (upstream default: `high`), while Grok 4.5 stops at `high`. |
109109

110110
The pinned GPT-5.6 entries preserve the exact upstream ladder. Sol and Terra expose `low` through
111111
`ultra`; Luna stops at `max`. Sol defaults to `low`, while Terra and Luna default to `medium`.

‎docs-site/src/content/docs/ko/guides/codex-app-models.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ GPT-5.6에만 사용합니다. 오래된 템플릿으로 근사하지 않고 모
8484
| OpenAI(API key) | 정확히 여덟 개의 네임스페이스 행: `gpt-5.5`, `gpt-5.6`, Sol/Terra/Luna, 그리고 세 개의 `*-pro` 가상 id (모두 컨텍스트 1,050,000; 최대 입력 922,000) |
8585
| OpenRouter | `openrouter/openai/gpt-5.6-sol`, `openrouter/openai/gpt-5.6-terra`, `openrouter/openai/gpt-5.6-luna` (1,050,000) |
8686
| Cursor | 정적 폴백에는 `cursor/gpt-5.6-sol`, `cursor/gpt-5.6-terra`, `cursor/gpt-5.6-luna` (1,000,000)와 `cursor/grok-4.5`, `cursor/grok-4.5-fast` (500,000)가 들어갑니다. 실시간 계정 탐색이 어떤 항목을 계속 보일지 정합니다. |
87-
| xAI | 실시간 탐색이 기준입니다. 폴백 카탈로그의 기본값은 `xai/grok-4.5`이고, 컨텍스트 500,000과 `low` / `medium` / `high` 추론 제어를 제공합니다. |
87+
| xAI | 실시간 탐색이 기준입니다. 폴백 카탈로그에는 `xai/grok-4.6`이 포함되며 기본값은 `xai/grok-4.5`입니다. 두 모델 모두 컨텍스트 창은 500,000입니다. Grok 4.6은 `low` / `medium` / `high` / `xhigh`(업스트림 기본값: `high`)를 제공하고, Grok 4.5는 `high`까지만 제공합니다. |
8888

8989
고정된 GPT-5.6 항목은 업스트림 ladder를 그대로 보존합니다. Sol과 Terra는 `low`부터 `ultra`까지 노출하고,
9090
Luna는 `max`에서 멈춥니다. Sol의 기본값은 `low`이고, Terra와 Luna의 기본값은 `medium`입니다. `ultra`는

‎docs-site/src/content/docs/ru/guides/codex-app-models.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ per-model identity и метаданные вместо приближения
9090
| OpenAI (API key) | Ровно восемь namespaced-строк: `gpt-5.5`, `gpt-5.6`, Sol/Terra/Luna и три виртуальных id `*-pro` (контекст 1,050,000; максимум входа 922,000 у всех восьми) |
9191
| OpenRouter | `openrouter/openai/gpt-5.6-sol`, `openrouter/openai/gpt-5.6-terra`, `openrouter/openai/gpt-5.6-luna` (1,050,000) |
9292
| Cursor | Статический fallback включает `cursor/gpt-5.6-sol`, `cursor/gpt-5.6-terra` и `cursor/gpt-5.6-luna` (1,000,000), а также `cursor/grok-4.5` и `cursor/grok-4.5-fast` (500,000); какие из них останутся видимыми, решает live-discovery аккаунта. |
93-
| xAI | Live-discovery авторитетно; fallback-каталог по умолчанию содержит `xai/grok-4.5` с окном 500,000 токенов и reasoning-control `low` / `medium` / `high`. |
93+
| xAI | Live-discovery авторитетно. Fallback-каталог включает `xai/grok-4.6`, а моделью по умолчанию остаётся `xai/grok-4.5`; у обеих окно 500,000 токенов. Grok 4.6 поддерживает `low` / `medium` / `high` / `xhigh` (upstream-default: `high`), а Grok 4.5 — только до `high`. |
9494

9595
Закреплённые записи GPT-5.6 сохраняют точную upstream-лестницу. Sol и Terra дают диапазон от
9696
`low` до `ultra`; у Luna верхняя ступень — `max`. По умолчанию у Sol стоит `low`, а у Terra и

‎docs-site/src/content/docs/zh-cn/guides/codex-app-models.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ visibility = "list"
7070
| OpenAI(API key) | 恰好八个命名空间行:`gpt-5.5`、`gpt-5.6`、Sol/Terra/Luna,以及三个 `*-pro` 虚拟 id(八个条目均为 1,050,000 context / 922,000 max input) |
7171
| OpenRouter | `openrouter/openai/gpt-5.6-sol`、`openrouter/openai/gpt-5.6-terra`、`openrouter/openai/gpt-5.6-luna`(1,050,000) |
7272
| Cursor | 静态回退包含 `cursor/gpt-5.6-sol`、`cursor/gpt-5.6-terra`、`cursor/gpt-5.6-luna`(1,000,000),以及 `cursor/grok-4.5` 和 `cursor/grok-4.5-fast`(500,000);实时账户发现会决定最终哪些条目仍然可见。 |
73-
| xAI | 实时发现具有权威性;回退目录默认使用 `xai/grok-4.5`,上下文窗口为 500,000,并提供 `low` / `medium` / `high` reasoning 控制。 |
73+
| xAI | 实时发现具有权威性。回退目录包含 `xai/grok-4.6`,默认模型仍为 `xai/grok-4.5`;两者的上下文窗口均为 500,000。Grok 4.6 提供 `low` / `medium` / `high` / `xhigh`(上游默认值为 `high`),Grok 4.5 最高为 `high`。 |
7474

7575
固定的 GPT-5.6 条目保留了精确的上游阶梯。Sol 和 Terra 暴露从 `low` 到 `ultra` 的档位;Luna 只到 `max`。Sol 默认是 `low`,Terra 和 Luna 默认是 `medium`。`ultra` 是面向客户端的最大 reasoning 加主动委派选项,在后端会以 `max` 传入。选择器里的一个条目只表示目录已经准备好:关联的账户或 API key 仍然必须有权使用该模型。
7676

‎docs-site/src/content/docs/zh-tw/guides/codex-app-models.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ GPT-5.6,以便提供每個模型真實的身份和後設資料,而不是套
9292
| OpenAI(API key) | 恰好八個帶名稱空間的列:`gpt-5.5`、`gpt-5.6`、Sol/Terra/Luna 與三個 `*-pro` 虛擬 id(全部八個都是 1,050,000 context;922,000 max input) |
9393
| OpenRouter | `openrouter/openai/gpt-5.6-sol`、`openrouter/openai/gpt-5.6-terra`、`openrouter/openai/gpt-5.6-luna`(1,050,000) |
9494
| Cursor | 靜態回退目錄包含 `cursor/gpt-5.6-sol`、`cursor/gpt-5.6-terra`、`cursor/gpt-5.6-luna`(1,000,000),以及 `cursor/grok-4.5`、`cursor/grok-4.5-fast`(500,000);帳號的即時發現結果決定最終顯示哪些模型。 |
95-
| xAI | 以即時發現結果為準;回退目錄預設使用 `xai/grok-4.5`,視窗為 500,000 token,並提供 `low` / `medium` / `high` reasoning 控制。 |
95+
| xAI | 以即時發現結果為準。回退目錄包含 `xai/grok-4.6`,預設模型仍為 `xai/grok-4.5`;兩者的 context window 均為 500,000。Grok 4.6 提供 `low` / `medium` / `high` / `xhigh`(上游預設值為 `high`),Grok 4.5 最高為 `high`。 |
9696

9797
固定的 GPT-5.6 條目會保留精確的上游 reasoning 階梯。Sol 和 Terra 從 `low` 到 `ultra`,Luna
9898
最高到 `max`。Sol 預設使用 `low`,Terra 和 Luna 預設使用 `medium`。`ultra` 是用戶端側的

‎src/providers/registry.ts‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -951,8 +951,8 @@ export const PROVIDER_REGISTRY: readonly ProviderRegistryEntry[] = [
951951
// devlog/model_update/260709_model_refresh/001_xai_lineup.md.
952952
// grok-4.20-multi-agent-0309 is intentionally absent: the OAuth chat-completions
953953
// transport returns 400 ("Multi Agent requests are not allowed on chat completions").
954-
// 260813: grok-4.6 added per the new docs.x.ai/developers/grok-4-6 page; specs mirrored
955-
// from grok-4.5 until the official capability/pricing tables settle.
954+
// 260813: grok-4.6 added per docs.x.ai/developers/grok-4-6. Context/vision still match
955+
// grok-4.5; the reasoning ladder does not — 4.6 adds the documented xhigh rung.
956956
models: ["grok-4.6", "grok-4.5", "grok-4.3", "grok-4.20-0309-reasoning", "grok-4.20-0309-non-reasoning", "grok-build-0.1", "grok-composer-2.5-fast"],
957957
defaultModel: "grok-4.5",
958958
// Vision lineup per docs.x.ai model-capabilities/images/understanding: the grok-4.x chat
@@ -974,8 +974,11 @@ export const PROVIDER_REGISTRY: readonly ProviderRegistryEntry[] = [
974974
// (docs.x.ai prompt-caching/multi-turn, verified 2026-07-13 — devlog/_plan/260713_grok_caching).
975975
// Models that never emit reasoning simply have no thinking parts to replay (no-op).
976976
preserveReasoningContentModels: ["grok-4.6", "grok-4.5", "grok-4.3", "grok-4.20-0309-reasoning"],
977-
// grok-4.5 reasoning is always-on with low/medium/high control (no off tier upstream).
978-
modelReasoningEfforts: { "grok-4.6": ["low", "medium", "high"], "grok-4.5": ["low", "medium", "high"] },
977+
// grok-4.5 reasoning is always-on with low/medium/high (no off tier, no xhigh).
978+
// grok-4.6 adds xhigh per docs.x.ai/developers/model-capabilities/text/reasoning;
979+
// xAI documents high as the upstream default.
980+
modelReasoningEfforts: { "grok-4.6": ["low", "medium", "high", "xhigh"], "grok-4.5": ["low", "medium", "high"] },
981+
modelDefaultReasoningEfforts: { "grok-4.6": "high" },
979982
modelContextWindows: {
980983
"grok-4.6": 500_000,
981984
"grok-4.5": 500_000,

‎tests/catalog-vision-sidecar-modalities.test.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ describe("vision-capable provider models feed combo modalities", () => {
156156
test("xAI grok chat models declare image input in the registry", () => {
157157
const xai = PROVIDER_REGISTRY.find(entry => entry.id === "xai");
158158
for (const model of [
159+
"grok-4.6",
159160
"grok-4.5",
160161
"grok-4.3",
161162
"grok-4.20-0309-reasoning",

‎tests/effort-policy.test.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,8 @@ describe("supportedLadderFor (real routeModel routes)", () => {
219219
} as Partial<OcxConfig>);
220220
const route = routeModel(config, "xai/grok-4.5");
221221
expect(supportedLadderFor(route)).toEqual(["low", "medium", "high"]);
222+
const grok46 = routeModel(config, "xai/grok-4.6");
223+
expect(supportedLadderFor(grok46)).toEqual(["low", "medium", "high", "xhigh"]);
222224
const noReasoning = routeModel(config, "xai/grok-composer-2.5-fast");
223225
expect(supportedLadderFor(noReasoning)).toEqual([]);
224226
});

‎tests/oauth-provider-reconcile.test.ts‎

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { join } from "node:path";
55
import { loadConfig } from "../src/config";
66
import { OAUTH_PROVIDERS, reconcileOAuthProviders, upsertOAuthProvider } from "../src/oauth";
77
import { getCredential, saveCredential } from "../src/oauth/store";
8+
import { routeModel } from "../src/router";
89
import type { OcxConfig } from "../src/types";
910

1011
const originalHome = process.env.OPENCODEX_HOME;
@@ -189,4 +190,40 @@ describe("OAuth provider reconciliation", () => {
189190
reconcileOAuthProviders(config);
190191
expect(config.providers.kimi.requiresReasoningPlaceholderModels).toEqual([]);
191192
});
193+
194+
test("refreshes Grok 4.6 levels while runtime fills the default without overwriting user intent", () => {
195+
const home = mkdtempSync(join(tmpdir(), "ocx-grok-46-reconcile-"));
196+
homes.push(home);
197+
process.env.OPENCODEX_HOME = home;
198+
const staleXai = structuredClone(OAUTH_PROVIDERS.xai.providerConfig);
199+
staleXai.modelReasoningEfforts = {
200+
"grok-4.6": ["low", "medium", "high"],
201+
"grok-4.5": ["low", "medium", "high"],
202+
};
203+
delete staleXai.modelDefaultReasoningEfforts;
204+
const config = {
205+
port: 10100,
206+
defaultProvider: "xai",
207+
providers: {
208+
xai: {
209+
...staleXai,
210+
note: "user-owned-note",
211+
},
212+
},
213+
} satisfies OcxConfig;
214+
215+
expect(reconcileOAuthProviders(config)).toBe(true);
216+
expect(config.providers.xai.modelReasoningEfforts?.["grok-4.6"])
217+
.toEqual(["low", "medium", "high", "xhigh"]);
218+
expect(config.providers.xai.modelDefaultReasoningEfforts).toBeUndefined();
219+
expect(routeModel(config, "xai/grok-4.6").provider.modelDefaultReasoningEfforts?.["grok-4.6"])
220+
.toBe("high");
221+
expect(config.providers.xai.note).toBe("user-owned-note");
222+
expect(reconcileOAuthProviders(config)).toBe(false);
223+
224+
config.providers.xai.modelDefaultReasoningEfforts = { "grok-4.6": "medium" };
225+
expect(reconcileOAuthProviders(config)).toBe(false);
226+
expect(routeModel(config, "xai/grok-4.6").provider.modelDefaultReasoningEfforts?.["grok-4.6"])
227+
.toBe("medium");
228+
});
192229
});

‎tests/provider-registry-parity.test.ts‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -674,9 +674,14 @@ describe("provider registry parity", () => {
674674
}
675675
expect(OAUTH_PROVIDERS.xai.providerConfig.defaultModel).toBe("grok-4.5");
676676
expect(OAUTH_PROVIDERS.xai.providerConfig.liveModels).toBe(true);
677+
expect(OAUTH_PROVIDERS.xai.providerConfig.models).toContain("grok-4.6");
677678
expect(OAUTH_PROVIDERS.xai.providerConfig.models).toContain("grok-4.5");
679+
expect(OAUTH_PROVIDERS.xai.providerConfig.modelContextWindows?.["grok-4.6"]).toBe(500_000);
678680
expect(OAUTH_PROVIDERS.xai.providerConfig.modelContextWindows?.["grok-4.5"]).toBe(500_000);
681+
expect(OAUTH_PROVIDERS.xai.providerConfig.modelReasoningEfforts?.["grok-4.6"]).toEqual(["low", "medium", "high", "xhigh"]);
679682
expect(OAUTH_PROVIDERS.xai.providerConfig.modelReasoningEfforts?.["grok-4.5"]).toEqual(["low", "medium", "high"]);
683+
expect(OAUTH_PROVIDERS.xai.providerConfig.modelDefaultReasoningEfforts).toEqual({ "grok-4.6": "high" });
684+
expect(OAUTH_PROVIDERS.xai.providerConfig.modelReasoningEffortMap).toBeUndefined();
680685
expect(OAUTH_PROVIDERS.xai.providerConfig.noVisionModels).toContain("grok-build-0.1");
681686
const antigravityRegistry = PROVIDER_REGISTRY.find(entry => entry.id === "google-antigravity");
682687
expect(antigravityRegistry?.liveModels).toBe(true);
@@ -851,6 +856,22 @@ describe("provider registry parity", () => {
851856
.toEqual(["low", "medium", "high", "max", "ultra"]);
852857
});
853858

859+
test("grok-4.6 advertises the documented xhigh rung from the xai registry seed", () => {
860+
const xai = PROVIDER_REGISTRY.find(entry => entry.id === "xai");
861+
const seed = providerConfigSeed(xai!);
862+
const model = applyProviderConfigHints("xai", seed, { id: "grok-4.6", provider: "xai" });
863+
expect(model.contextWindow).toBe(500_000);
864+
expect(model.reasoningEfforts).toEqual(["low", "medium", "high", "xhigh"]);
865+
866+
const entries = buildCatalogEntries(nativeTemplate() as never, [], [model]);
867+
const entry = entries.find(e => e.slug === "xai/grok-4.6");
868+
expect(entry).toBeTruthy();
869+
expect(entry?.context_window).toBe(500_000);
870+
expect((entry?.supported_reasoning_levels as { effort: string }[]).map(l => l.effort))
871+
.toEqual(["low", "medium", "high", "xhigh", "max", "ultra"]);
872+
expect(entry?.default_reasoning_level).toBe("high");
873+
});
874+
854875
// The id-list assertion above only proves the preset exists. Pin the contract a user actually
855876
// depends on: which endpoint the key is sent to, which adapter parses the stream, and that the
856877
// vendor-namespaced seed models survive into a real catalog entry.

0 commit comments

Comments
 (0)