Skip to content

Commit d8bf2bc

Browse files
committed
Merge dev into main: Windows suite green
2 parents 9dcecfe + bb984ad commit d8bf2bc

79 files changed

Lines changed: 822 additions & 302 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# 070 — Native GPT-5.6 default follows Codex 272k
2+
3+
## Change
4+
5+
- `NATIVE_GPT56_CONTEXT_WINDOW` is 272,000 (Codex live advertised default).
6+
- Measured ceiling / 1M opt-in stays `NATIVE_GPT56_MAX_INPUT_TOKENS` = 922,000.
7+
- For the GPT-5.6 family only, `providerContextCaps.openai` and per-model overlays may RAISE the default up to 922k. Values above 922k clamp. Other native slugs still only lower.
8+
- Native group switch ON without a value sends 922,000. Switch OFF displays 272k.
9+
- API-key 1,050,000 / 922,000 path is unchanged. gpt-5.4 stays 1M. gpt-5.5 stays 272k.
10+
11+
## Files
12+
13+
- `src/codex/catalog/metadata.ts`
14+
- `gui/src/pages/Models.tsx`
15+
- `gui/src/pages/models-shared.ts`
16+
- `structure/08_openai-provider-tiers.md`
17+
- focused tests listed in the same commit
18+
19+
## Accept
20+
21+
- `nativeOpenAiContextWindow("gpt-5.6-sol") === 272000`
22+
- `nativeOpenAiContextWindow("gpt-5.6-sol", 922000) === 922000`
23+
- `nativeOpenAiContextWindow("gpt-5.6-sol", 2000000) === 922000`
24+
- `nativeOpenAiContextWindow("gpt-5.5", 922000) === 272000`
25+
- Claude default sol is unmarked; opted-in 922k marks `[1m]`

‎gui/src/pages/Models.tsx‎

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ import {
5151
fmtK,
5252
NATIVE_CAP_OPTIONS,
5353
NATIVE_CAP_OPTION_SET,
54+
NATIVE_GPT56_DEFAULT_WINDOW,
55+
NATIVE_GPT56_OPT_IN_WINDOW,
5456
PAGE,
5557
readCollapsedProviders,
5658
THREAD_OPTION_SET,
@@ -629,7 +631,7 @@ export default function Models({ apiBase, restartEpoch = 0 }: { apiBase: string;
629631
}
630632
};
631633

632-
const toggleProviderCap = async (provider: string) => {
634+
const toggleProviderCap = async (provider: string, nativeGroup = false) => {
633635
setBusy(true);
634636
busyRef.current = true;
635637
setStatus("");
@@ -640,7 +642,9 @@ export default function Models({ apiBase, restartEpoch = 0 }: { apiBase: string;
640642
const r = await fetch(`${apiBase}/api/provider-context-caps`, {
641643
method: "PUT",
642644
headers: { "Content-Type": "application/json" },
643-
body: JSON.stringify({ provider, enabled }),
645+
body: JSON.stringify(enabled && nativeGroup
646+
? { provider, enabled, value: NATIVE_GPT56_OPT_IN_WINDOW }
647+
: { provider, enabled }),
644648
});
645649
try {
646650
const data = await readJsonOrThrow<ProviderContextCapsResponse>(r, t("models.capSaveFailed"));
@@ -1025,7 +1029,9 @@ export default function Models({ apiBase, restartEpoch = 0 }: { apiBase: string;
10251029
if (window === undefined) return widest;
10261030
return widest === undefined || window > widest ? window : widest;
10271031
}, undefined);
1028-
const capDisplayValue = capOn ? providerCap : (widestRowWindow ?? providerCap);
1032+
const capDisplayValue = capOn
1033+
? providerCap
1034+
: (nativeProviderGroup ? NATIVE_GPT56_DEFAULT_WINDOW : (widestRowWindow ?? providerCap));
10291035
// The native group offers only the three windows GPT-5.6 actually has contracts for
10301036
// (272k live, 372k legacy, 1.05M measured); routed providers keep the generic ladder.
10311037
// The set has to follow the list, or a saved value outside it loses its option.
@@ -1118,7 +1124,7 @@ export default function Models({ apiBase, restartEpoch = 0 }: { apiBase: string;
11181124
<button type="button" className="btn btn-ghost btn-sm text-caption" disabled={busy || allOn} onClick={() => bulkToggle(true)}>{t("models.allOn")}</button>
11191125
<button type="button" className="btn btn-ghost btn-sm text-caption" disabled={busy || allOff} onClick={() => bulkToggle(false)}>{t("models.allOff")}</button>
11201126
<>
1121-
<Switch on={capOn} onClick={() => toggleProviderCap(provider)} disabled={busy} label={t("models.capValue", { value: fmtK(capDisplayValue) })} />
1127+
<Switch on={capOn} onClick={() => toggleProviderCap(provider, nativeProviderGroup)} disabled={busy} label={t("models.capValue", { value: fmtK(capDisplayValue) })} />
11221128
{/* The native group keeps the value visible with the cap off: its rows always
11231129
advertise SOME window, so hiding the number leaves the card saying nothing
11241130
about the context Codex will actually see. Routed providers keep the old

‎gui/src/pages/models-shared.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,9 @@ export const CAP_OPTION_SET = new Set(CAP_OPTIONS);
8484
* window, so listing a value above the advertised one would be an inert choice.
8585
* Anything else goes through "Custom".
8686
*/
87-
export const NATIVE_CAP_OPTIONS = [272_000, 372_000, 922_000];
87+
export const NATIVE_GPT56_DEFAULT_WINDOW = 272_000;
88+
export const NATIVE_GPT56_OPT_IN_WINDOW = 922_000;
89+
export const NATIVE_CAP_OPTIONS = [NATIVE_GPT56_DEFAULT_WINDOW, 372_000, NATIVE_GPT56_OPT_IN_WINDOW];
8890
export const NATIVE_CAP_OPTION_SET = new Set(NATIVE_CAP_OPTIONS);
8991
export const CUSTOM_OPTION = "custom";
9092
export const THREAD_OPTIONS = [4, 8, 16, 32, 64, 128, 256, 500, 1000];

‎gui/tests/models-native-group-controls.test.ts‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,12 @@ test("the native group keeps its window readable with the cap switched off", asy
6060
expect(src).toContain("{(capOn || nativeProviderGroup) && (");
6161
// With the cap off the stored value is only what a future toggle would apply — the 350k
6262
// default — so the display falls back to the widest window the rows actually advertise.
63-
expect(src).toContain("const capDisplayValue = capOn ? providerCap : (widestRowWindow ?? providerCap);");
63+
// Matched as separate fragments because the expression is wrapped across lines now, and
64+
// it grew a native branch: with the cap off the native group shows its default window
65+
// rather than the widest advertised row. A single-line literal pinned the formatting
66+
// instead of the behaviour and broke on the reflow that introduced that branch.
67+
expect(src).toContain("const capDisplayValue = capOn");
68+
expect(src).toContain("nativeProviderGroup ? NATIVE_GPT56_DEFAULT_WINDOW : (widestRowWindow ?? providerCap)");
6469
// The select is inert until the cap is actually on: showing a number is not the same as
6570
// offering to change one.
6671
expect(src).toContain("disabled={busy || !capOn}");

‎scripts/test.ts‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,17 @@ export function createIsolatedTestEnvironment(
3737
// real-home write guard can still know which path to protect.
3838
// (devlog 260730_codex_rs_upstream_v2_live_handoff/070.)
3939
OCX_REAL_HOME: baseEnv.OCX_REAL_HOME ?? homedir(),
40+
// Pin git's global config to the developer's real one before HOME moves.
41+
//
42+
// git resolves ~/.gitconfig from HOME, so a sandboxed HOME makes it invisible.
43+
// That silently drops `safe.directory`, and on a checkout whose directory owner
44+
// differs from the running account -- ordinary on Windows when a tool or
45+
// installer created the tree -- every `git` call a test makes then fails with
46+
// "detected dubious ownership". The test reads that as "this is not a git
47+
// repository" and asserts against a fallback, which looks like a product bug in
48+
// whichever adapter collected the metadata. Naming the file keeps the sandbox
49+
// (git still writes nothing here) while leaving git's own trust decisions intact.
50+
GIT_CONFIG_GLOBAL: baseEnv.GIT_CONFIG_GLOBAL ?? join(homedir(), ".gitconfig"),
4051
HOME: root,
4152
USERPROFILE: root,
4253
OPENCODEX_HOME: opencodexHome,

‎src/claude/context-windows.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*/
1111
import { aliasForNative, aliasForRoute } from "./alias";
1212
import { desktop3pAlias } from "./desktop-3p";
13-
import { nativeOpenAiContextWindow, type CatalogModel } from "../codex/catalog";
13+
import { nativeOpenAiContextWindow, type CatalogModel, type NativeContextLimitsInput } from "../codex/catalog";
1414

1515
const ONE_MILLION = 1_000_000;
1616

@@ -104,7 +104,7 @@ export function buildClaudeContextWindows(
104104
// A configured providerContextCaps.openai has to reach the native rows here too. Without
105105
// it the Claude surface keeps advertising the uncapped authoritative window while the
106106
// Codex catalog advertises the capped one, and the two disagree about the same model.
107-
nativeContextCap?: number,
107+
nativeContextCap?: NativeContextLimitsInput,
108108
): Record<string, number> {
109109
const out: Record<string, number> = {};
110110
const put = (key: string | null, value: number) => {

‎src/claude/desktop-3p.ts‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
renderDesktopProfile,
1111
type DesktopProfileModel,
1212
} from "./desktop-profile";
13-
import { nativeOpenAiContextWindow } from "../codex/catalog";
13+
import { nativeOpenAiContextWindow, type NativeContextLimitsInput } from "../codex/catalog";
1414
import { assertDesktop3pModelsValid } from "./desktop-3p-guard";
1515

1616
export interface Desktop3pModelEntry {
@@ -191,7 +191,7 @@ function collectDesktop3pModels(
191191
nativeSlugs: string[],
192192
routedModels: Array<Desktop3pRoutedModel>,
193193
profile?: OcxClaudeDesktopProfile,
194-
nativeContextCap?: number,
194+
nativeContextCap?: NativeContextLimitsInput,
195195
): { models: Desktop3pModelEntry[]; registry: Map<string, string> } {
196196
const registry = new Map<string, string>();
197197
const models: Desktop3pModelEntry[] = [];
@@ -293,7 +293,7 @@ export function buildDesktop3pRegistry(
293293
nativeSlugs: string[],
294294
routedModels: Array<Desktop3pRoutedModel>,
295295
profile?: OcxClaudeDesktopProfile,
296-
nativeContextCap?: number,
296+
nativeContextCap?: NativeContextLimitsInput,
297297
): Map<string, string> {
298298
const { registry } = collectDesktop3pModels(nativeSlugs, routedModels, profile, nativeContextCap);
299299
desktop3pRegistry = registry;
@@ -305,7 +305,7 @@ export function generateDesktop3pModels(
305305
nativeSlugs: string[],
306306
routedModels: Array<Desktop3pRoutedModel>,
307307
profile?: OcxClaudeDesktopProfile,
308-
nativeContextCap?: number,
308+
nativeContextCap?: NativeContextLimitsInput,
309309
): Desktop3pModelEntry[] {
310310
const { models, registry } = collectDesktop3pModels(nativeSlugs, routedModels, profile, nativeContextCap);
311311
desktop3pRegistry = registry;
@@ -337,7 +337,7 @@ export function generateDesktop3pConfig(
337337
apiKey = "ocx",
338338
mode: Desktop3pConfigMode = "static",
339339
profile?: OcxClaudeDesktopProfile,
340-
nativeContextCap?: number,
340+
nativeContextCap?: NativeContextLimitsInput,
341341
): object {
342342
const base = {
343343
inferenceProvider: "gateway",
@@ -558,7 +558,7 @@ export function writeDesktop3pConfig(
558558
apiKey?: string,
559559
mode: Desktop3pConfigMode = "static",
560560
profile?: OcxClaudeDesktopProfile,
561-
nativeContextCap?: number,
561+
nativeContextCap?: NativeContextLimitsInput,
562562
): { written: boolean; path: string; reason?: string; fingerprint?: string } {
563563
const libraryPath = resolveDesktop3pConfigLibraryPath();
564564
const metadataPath = join(libraryPath, "_meta.json");

‎src/claude/model-info.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* - created_at is a fixed constant; max_input_tokens is authoritative-or-null;
1616
* max_tokens is always null (no authoritative output limit exists proxy-side).
1717
*/
18-
import { catalogModelEfforts, nativeEffortClamp, nativeOpenAiContextWindow, nativeOpenAiMaxInputTokens, type CatalogModel } from "../codex/catalog";
18+
import { catalogModelEfforts, nativeEffortClamp, nativeOpenAiContextWindow, nativeOpenAiMaxInputTokens, type CatalogModel, type NativeContextLimitsInput } from "../codex/catalog";
1919
import { claudeCodeAlias, claudeCodeNativeAlias } from "./alias";
2020
import { desktop3pAlias } from "./desktop-3p";
2121
import { AUTO_CONTEXT_OFF, type AutoContextMode } from "./context-windows";
@@ -108,7 +108,7 @@ export function buildAnthropicModelInfos(
108108
auto: AutoContextMode = AUTO_CONTEXT_OFF,
109109
idStyle: AnthropicIdStyle = "desktop3p",
110110
aliasForRoute: (provider: string, modelId: string) => string = desktop3pAlias,
111-
nativeContextCap?: number,
111+
nativeContextCap?: NativeContextLimitsInput,
112112
): AnthropicModelInfo[] {
113113
const out: AnthropicModelInfo[] = [];
114114
const seen = new Set<string>();

‎src/cli/claude-desktop.ts‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,10 @@ import {
1111
type DesktopProfile,
1212
} from "../claude/desktop-profile";
1313
import { writeDesktop3pConfig, type Desktop3pConfigMode, parseDesktop3pModeArgs } from "../claude/desktop-3p";
14-
import { filterCatalogVisibleModels, desktopVisibleNativeSlugs } from "../codex/catalog";
14+
import { filterCatalogVisibleModels, desktopVisibleNativeSlugs, nativeContextLimits } from "../codex/catalog";
1515
import { buildClaudeDesktopState, fetchAllModels } from "../server/management-api";
1616
import { findLiveProxy } from "../server/proxy-liveness";
1717
import { runtimeRequest } from "./runtime-api";
18-
import { providerContextCap } from "../providers/context-cap";
1918
import { OPENAI_CODEX_PROVIDER_ID } from "../providers/openai-tiers";
2019

2120
function isFamily(value: string | undefined): value is DesktopFamily {
@@ -100,7 +99,7 @@ export async function applyProfile(
10099
config.apiKeys?.[0]?.key,
101100
mode,
102101
state.profile,
103-
providerContextCap(config, OPENAI_CODEX_PROVIDER_ID),
102+
nativeContextLimits(config),
104103
);
105104
return { ok: result.written, path: result.path, reason: result.reason };
106105
}

‎src/codex/catalog.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Public surface preserved exactly; importers keep using "src/codex/catalog".
33
export { isMediaGenerationModelId, shouldExposeRoutedModel, readCodexCatalogPath, readCatalog, normalizeRoutedCatalogEntry, catalogModelSlug, filterSupportedNativeSlugs, catalogModelSupportsReasoningSummaries } from "./catalog/parsing";
44
export type { CatalogModel, MultiAgentMode } from "./catalog/parsing";
5-
export { accountBoundNativeOpenAiSlugs, accountBoundNativeOpenAiSlugsBySelector, CODEX_NATIVE_ALIAS_CATALOG_KIND, NATIVE_DAYBREAK_BLUE_MODEL, NATIVE_GPT56_MAX_INPUT_TOKENS, NATIVE_OPENAI_CAPABILITY_ALIAS_MODELS, NATIVE_OPENAI_MODELS, configuredNativeAliasSlugs, desktopAllowlistSuppressedNativeSlugs, isNativeAliasCatalogEntry, isNativeOpenAiCapabilityAliasModel, nativeContextLimits, nativeOpenAiCapabilitySourceSlug, nativeOpenAiContextWindow, nativeOpenAiMaxInputTokens, disabledNativeSlugs, visibleNativeSlugs, desktopVisibleNativeSlugs, nativeModelRows, applyNativeVisibility, observedAccountBoundNativeEntries, observedAccountBoundNativeOpenAiSlugs, upstreamNativeEntry, nativeOpenAiSlugs, listCatalogNativeSlugs, nativeInputModalities, nativeReasoningEfforts, nativeDefaultReasoningEffort, shouldIncludeAccountBoundNativeOpenAi, shouldIncludeNativeOpenAi, type NativeContextLimits, type NativeContextLimitsInput } from "./catalog/metadata";
5+
export { accountBoundNativeOpenAiSlugs, accountBoundNativeOpenAiSlugsBySelector, CODEX_NATIVE_ALIAS_CATALOG_KIND, NATIVE_DAYBREAK_BLUE_MODEL, NATIVE_GPT56_CONTEXT_WINDOW, NATIVE_GPT56_MAX_INPUT_TOKENS, NATIVE_GPT56_OPT_IN_CONTEXT_WINDOW, NATIVE_OPENAI_CAPABILITY_ALIAS_MODELS, NATIVE_OPENAI_MODELS, configuredNativeAliasSlugs, desktopAllowlistSuppressedNativeSlugs, isNativeAliasCatalogEntry, isNativeOpenAiCapabilityAliasModel, nativeContextLimits, nativeOpenAiCapabilitySourceSlug, nativeOpenAiContextWindow, nativeOpenAiMaxInputTokens, disabledNativeSlugs, visibleNativeSlugs, desktopVisibleNativeSlugs, nativeModelRows, applyNativeVisibility, observedAccountBoundNativeEntries, observedAccountBoundNativeOpenAiSlugs, upstreamNativeEntry, nativeOpenAiSlugs, listCatalogNativeSlugs, nativeInputModalities, nativeReasoningEfforts, nativeDefaultReasoningEffort, shouldIncludeAccountBoundNativeOpenAi, shouldIncludeNativeOpenAi, type NativeContextLimits, type NativeContextLimitsInput } from "./catalog/metadata";
66
export { isSpawnableCodexCandidate, codexExecInvocation, loadBundledCodexCatalog, materializeBundledCodexCatalog, loadCatalogTemplate } from "./catalog/bundled";
77
export { nativeEffortClamp, shouldApplyNativeEffortClamp, catalogModelEfforts, codexSupportedReasoningEfforts, clampedDefaultEffort, clampEntryToCodexSupportedEfforts, clampCatalogModelsToCodexSupport } from "./catalog/effort";
88
export { applyProviderConfigHints, isDatedVariantId, filterCatalogVisibleModels, gatherRoutedModels, clearGatherRoutedModelsInflight, augmentRoutedModelsWithRegistryOpenAiApiRows, augmentRoutedModelsWithMetadata, resolveComboCatalogMember, configuredComboTargetModelsByProvider } from "./catalog/provider-fetch";

0 commit comments

Comments
 (0)