codex-multi-auth 2.15.0 → 2.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.codex-plugin/plugin.json +1 -1
- package/README.md +1 -1
- package/config/README.md +2 -2
- package/config/codex-legacy.json +109 -184
- package/config/codex-modern.json +44 -114
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/lib/context-budget/model-context-windows.d.ts +1 -1
- package/dist/lib/context-budget/model-context-windows.d.ts.map +1 -1
- package/dist/lib/context-budget/model-context-windows.js +9 -10
- package/dist/lib/prompts/codex.d.ts.map +1 -1
- package/dist/lib/prompts/codex.js +3 -1
- package/dist/lib/request/error-classification.d.ts.map +1 -1
- package/dist/lib/request/error-classification.js +39 -25
- package/dist/lib/request/fetch-helpers.js +1 -1
- package/dist/lib/request/helpers/model-map.d.ts +12 -2
- package/dist/lib/request/helpers/model-map.d.ts.map +1 -1
- package/dist/lib/request/helpers/model-map.js +174 -147
- package/dist/lib/runtime-rotation-proxy.d.ts.map +1 -1
- package/dist/lib/runtime-rotation-proxy.js +3 -4
- package/dist/lib/usage/pricing.d.ts +19 -2
- package/dist/lib/usage/pricing.d.ts.map +1 -1
- package/dist/lib/usage/pricing.js +100 -39
- package/package.json +1 -1
- package/scripts/codex.js +109 -104
package/config/codex-modern.json
CHANGED
|
@@ -111,10 +111,10 @@
|
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
113
|
},
|
|
114
|
-
"gpt-
|
|
115
|
-
"name": "GPT
|
|
114
|
+
"gpt-6-sol": {
|
|
115
|
+
"name": "GPT 6 Sol (OAuth)",
|
|
116
116
|
"limit": {
|
|
117
|
-
"context":
|
|
117
|
+
"context": 272000,
|
|
118
118
|
"output": 128000
|
|
119
119
|
},
|
|
120
120
|
"modalities": {
|
|
@@ -159,10 +159,10 @@
|
|
|
159
159
|
}
|
|
160
160
|
}
|
|
161
161
|
},
|
|
162
|
-
"gpt-
|
|
163
|
-
"name": "GPT
|
|
162
|
+
"gpt-6-luna": {
|
|
163
|
+
"name": "GPT 6 Luna (OAuth)",
|
|
164
164
|
"limit": {
|
|
165
|
-
"context":
|
|
165
|
+
"context": 272000,
|
|
166
166
|
"output": 128000
|
|
167
167
|
},
|
|
168
168
|
"modalities": {
|
|
@@ -199,16 +199,11 @@
|
|
|
199
199
|
"reasoningEffort": "max",
|
|
200
200
|
"reasoningSummary": "detailed",
|
|
201
201
|
"textVerbosity": "medium"
|
|
202
|
-
},
|
|
203
|
-
"ultra": {
|
|
204
|
-
"reasoningEffort": "ultra",
|
|
205
|
-
"reasoningSummary": "detailed",
|
|
206
|
-
"textVerbosity": "medium"
|
|
207
202
|
}
|
|
208
203
|
}
|
|
209
204
|
},
|
|
210
|
-
"gpt-5.6-
|
|
211
|
-
"name": "GPT 5.6
|
|
205
|
+
"gpt-5.6-sol": {
|
|
206
|
+
"name": "GPT 5.6 Sol (OAuth)",
|
|
212
207
|
"limit": {
|
|
213
208
|
"context": 372000,
|
|
214
209
|
"output": 128000
|
|
@@ -247,13 +242,18 @@
|
|
|
247
242
|
"reasoningEffort": "max",
|
|
248
243
|
"reasoningSummary": "detailed",
|
|
249
244
|
"textVerbosity": "medium"
|
|
245
|
+
},
|
|
246
|
+
"ultra": {
|
|
247
|
+
"reasoningEffort": "ultra",
|
|
248
|
+
"reasoningSummary": "detailed",
|
|
249
|
+
"textVerbosity": "medium"
|
|
250
250
|
}
|
|
251
251
|
}
|
|
252
252
|
},
|
|
253
|
-
"gpt-5.
|
|
254
|
-
"name": "GPT 5.
|
|
253
|
+
"gpt-5.6-terra": {
|
|
254
|
+
"name": "GPT 5.6 Terra (OAuth)",
|
|
255
255
|
"limit": {
|
|
256
|
-
"context":
|
|
256
|
+
"context": 372000,
|
|
257
257
|
"output": 128000
|
|
258
258
|
},
|
|
259
259
|
"modalities": {
|
|
@@ -266,11 +266,6 @@
|
|
|
266
266
|
]
|
|
267
267
|
},
|
|
268
268
|
"variants": {
|
|
269
|
-
"none": {
|
|
270
|
-
"reasoningEffort": "none",
|
|
271
|
-
"reasoningSummary": "auto",
|
|
272
|
-
"textVerbosity": "medium"
|
|
273
|
-
},
|
|
274
269
|
"low": {
|
|
275
270
|
"reasoningEffort": "low",
|
|
276
271
|
"reasoningSummary": "auto",
|
|
@@ -290,46 +285,23 @@
|
|
|
290
285
|
"reasoningEffort": "xhigh",
|
|
291
286
|
"reasoningSummary": "detailed",
|
|
292
287
|
"textVerbosity": "medium"
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
},
|
|
296
|
-
"gpt-5.5-pro": {
|
|
297
|
-
"name": "GPT 5.5 Pro (OAuth)",
|
|
298
|
-
"limit": {
|
|
299
|
-
"context": 272000,
|
|
300
|
-
"output": 128000
|
|
301
|
-
},
|
|
302
|
-
"modalities": {
|
|
303
|
-
"input": [
|
|
304
|
-
"text",
|
|
305
|
-
"image"
|
|
306
|
-
],
|
|
307
|
-
"output": [
|
|
308
|
-
"text"
|
|
309
|
-
]
|
|
310
|
-
},
|
|
311
|
-
"variants": {
|
|
312
|
-
"medium": {
|
|
313
|
-
"reasoningEffort": "medium",
|
|
314
|
-
"reasoningSummary": "detailed",
|
|
315
|
-
"textVerbosity": "medium"
|
|
316
288
|
},
|
|
317
|
-
"
|
|
318
|
-
"reasoningEffort": "
|
|
289
|
+
"max": {
|
|
290
|
+
"reasoningEffort": "max",
|
|
319
291
|
"reasoningSummary": "detailed",
|
|
320
292
|
"textVerbosity": "medium"
|
|
321
293
|
},
|
|
322
|
-
"
|
|
323
|
-
"reasoningEffort": "
|
|
294
|
+
"ultra": {
|
|
295
|
+
"reasoningEffort": "ultra",
|
|
324
296
|
"reasoningSummary": "detailed",
|
|
325
297
|
"textVerbosity": "medium"
|
|
326
298
|
}
|
|
327
299
|
}
|
|
328
300
|
},
|
|
329
|
-
"gpt-5.
|
|
330
|
-
"name": "GPT 5.
|
|
301
|
+
"gpt-5.6-luna": {
|
|
302
|
+
"name": "GPT 5.6 Luna (OAuth)",
|
|
331
303
|
"limit": {
|
|
332
|
-
"context":
|
|
304
|
+
"context": 372000,
|
|
333
305
|
"output": 128000
|
|
334
306
|
},
|
|
335
307
|
"modalities": {
|
|
@@ -342,11 +314,6 @@
|
|
|
342
314
|
]
|
|
343
315
|
},
|
|
344
316
|
"variants": {
|
|
345
|
-
"none": {
|
|
346
|
-
"reasoningEffort": "none",
|
|
347
|
-
"reasoningSummary": "auto",
|
|
348
|
-
"textVerbosity": "medium"
|
|
349
|
-
},
|
|
350
317
|
"low": {
|
|
351
318
|
"reasoningEffort": "low",
|
|
352
319
|
"reasoningSummary": "auto",
|
|
@@ -366,11 +333,16 @@
|
|
|
366
333
|
"reasoningEffort": "xhigh",
|
|
367
334
|
"reasoningSummary": "detailed",
|
|
368
335
|
"textVerbosity": "medium"
|
|
336
|
+
},
|
|
337
|
+
"max": {
|
|
338
|
+
"reasoningEffort": "max",
|
|
339
|
+
"reasoningSummary": "detailed",
|
|
340
|
+
"textVerbosity": "medium"
|
|
369
341
|
}
|
|
370
342
|
}
|
|
371
343
|
},
|
|
372
|
-
"gpt-5.
|
|
373
|
-
"name": "GPT 5.
|
|
344
|
+
"gpt-5.5": {
|
|
345
|
+
"name": "GPT 5.5 (OAuth)",
|
|
374
346
|
"limit": {
|
|
375
347
|
"context": 272000,
|
|
376
348
|
"output": 128000
|
|
@@ -385,9 +357,19 @@
|
|
|
385
357
|
]
|
|
386
358
|
},
|
|
387
359
|
"variants": {
|
|
360
|
+
"none": {
|
|
361
|
+
"reasoningEffort": "none",
|
|
362
|
+
"reasoningSummary": "auto",
|
|
363
|
+
"textVerbosity": "medium"
|
|
364
|
+
},
|
|
365
|
+
"low": {
|
|
366
|
+
"reasoningEffort": "low",
|
|
367
|
+
"reasoningSummary": "auto",
|
|
368
|
+
"textVerbosity": "medium"
|
|
369
|
+
},
|
|
388
370
|
"medium": {
|
|
389
371
|
"reasoningEffort": "medium",
|
|
390
|
-
"reasoningSummary": "
|
|
372
|
+
"reasoningSummary": "auto",
|
|
391
373
|
"textVerbosity": "medium"
|
|
392
374
|
},
|
|
393
375
|
"high": {
|
|
@@ -402,50 +384,8 @@
|
|
|
402
384
|
}
|
|
403
385
|
}
|
|
404
386
|
},
|
|
405
|
-
"gpt-5.
|
|
406
|
-
"name": "GPT 5.
|
|
407
|
-
"limit": {
|
|
408
|
-
"context": 272000,
|
|
409
|
-
"output": 128000
|
|
410
|
-
},
|
|
411
|
-
"modalities": {
|
|
412
|
-
"input": [
|
|
413
|
-
"text",
|
|
414
|
-
"image"
|
|
415
|
-
],
|
|
416
|
-
"output": [
|
|
417
|
-
"text"
|
|
418
|
-
]
|
|
419
|
-
},
|
|
420
|
-
"options": {
|
|
421
|
-
"reasoningEffort": "medium",
|
|
422
|
-
"reasoningSummary": "auto",
|
|
423
|
-
"textVerbosity": "medium"
|
|
424
|
-
}
|
|
425
|
-
},
|
|
426
|
-
"gpt-5.4-nano": {
|
|
427
|
-
"name": "GPT 5.4 Nano (OAuth)",
|
|
428
|
-
"limit": {
|
|
429
|
-
"context": 272000,
|
|
430
|
-
"output": 128000
|
|
431
|
-
},
|
|
432
|
-
"modalities": {
|
|
433
|
-
"input": [
|
|
434
|
-
"text",
|
|
435
|
-
"image"
|
|
436
|
-
],
|
|
437
|
-
"output": [
|
|
438
|
-
"text"
|
|
439
|
-
]
|
|
440
|
-
},
|
|
441
|
-
"options": {
|
|
442
|
-
"reasoningEffort": "medium",
|
|
443
|
-
"reasoningSummary": "auto",
|
|
444
|
-
"textVerbosity": "medium"
|
|
445
|
-
}
|
|
446
|
-
},
|
|
447
|
-
"gpt-5.3-codex": {
|
|
448
|
-
"name": "GPT 5.3 Codex (OAuth)",
|
|
387
|
+
"gpt-5.5-pro": {
|
|
388
|
+
"name": "GPT 5.5 Pro (OAuth)",
|
|
449
389
|
"limit": {
|
|
450
390
|
"context": 272000,
|
|
451
391
|
"output": 128000
|
|
@@ -460,14 +400,9 @@
|
|
|
460
400
|
]
|
|
461
401
|
},
|
|
462
402
|
"variants": {
|
|
463
|
-
"low": {
|
|
464
|
-
"reasoningEffort": "low",
|
|
465
|
-
"reasoningSummary": "auto",
|
|
466
|
-
"textVerbosity": "medium"
|
|
467
|
-
},
|
|
468
403
|
"medium": {
|
|
469
404
|
"reasoningEffort": "medium",
|
|
470
|
-
"reasoningSummary": "
|
|
405
|
+
"reasoningSummary": "detailed",
|
|
471
406
|
"textVerbosity": "medium"
|
|
472
407
|
},
|
|
473
408
|
"high": {
|
|
@@ -480,11 +415,6 @@
|
|
|
480
415
|
"reasoningSummary": "detailed",
|
|
481
416
|
"textVerbosity": "medium"
|
|
482
417
|
}
|
|
483
|
-
},
|
|
484
|
-
"options": {
|
|
485
|
-
"reasoningEffort": "high",
|
|
486
|
-
"reasoningSummary": "detailed",
|
|
487
|
-
"textVerbosity": "medium"
|
|
488
418
|
}
|
|
489
419
|
}
|
|
490
420
|
}
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAe,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAe,MAAM,kBAAkB,CAAC;AA+W5D;;;;;;;;;;;;;;;GAeG;AAEH,eAAO,MAAM,iBAAiB,EAAE,MA80I/B,CAAC;AAEF,eAAO,MAAM,gBAAgB,KAAoB,CAAC;AAElD,eAAe,iBAAiB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -63,6 +63,7 @@ import { evaluateFailurePolicy, } from "./lib/request/failure-policy.js";
|
|
|
63
63
|
import { applyProxyCompatibleInit, createCodexHeaders, extractRequestUrl, getUnsupportedCodexModelInfo, handleErrorResponse, handleSuccessResponse, isWorkspaceDisabledError, refreshAndUpdateToken, resolveUnsupportedCodexFallbackModel, rewriteUrlForCodex, shouldRefreshToken, transformRequestForCodex, } from "./lib/request/fetch-helpers.js";
|
|
64
64
|
import { configureRateLimitBackoff, getRateLimitBackoff, MAX_SHORT_RETRY_ATTEMPTS, getRateLimitShortRetryThresholdMs as getConfiguredRateLimitShortRetryThresholdMs, resetRateLimitBackoff, } from "./lib/request/rate-limit-backoff.js";
|
|
65
65
|
import { normalizeRequestInit, parseRequestBodyFromInit, } from "./lib/request/request-init.js";
|
|
66
|
+
import { CURRENT_CODEX_MODEL } from "./lib/request/helpers/model-map.js";
|
|
66
67
|
import { applyFastSessionDefaults } from "./lib/request/request-transformer.js";
|
|
67
68
|
import { applyResponseCompaction } from "./lib/request/response-compaction.js";
|
|
68
69
|
import { isEmptyResponse } from "./lib/request/response-handler.js";
|
|
@@ -1202,7 +1203,7 @@ export const OpenAIOAuthPlugin = async ({ client }) => {
|
|
|
1202
1203
|
customChain: unsupportedCodexFallbackChain,
|
|
1203
1204
|
});
|
|
1204
1205
|
if (fallbackModel) {
|
|
1205
|
-
const previousModel = model ??
|
|
1206
|
+
const previousModel = model ?? CURRENT_CODEX_MODEL;
|
|
1206
1207
|
const previousModelFamily = modelFamily;
|
|
1207
1208
|
attemptedUnsupportedFallbackModels.add(previousModel);
|
|
1208
1209
|
attemptedUnsupportedFallbackModels.add(fallbackModel);
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* behavior (see the v2.5.0 release notes) closely enough to launch that no
|
|
7
7
|
* estimate here has been reviewed for it yet.
|
|
8
8
|
*/
|
|
9
|
-
export declare const UNESTIMATED_ROUTABLE_MODELS: readonly ["gpt-5.6-sol", "gpt-5.6-terra", "gpt-5.6-luna", "gpt-6-astra", "gpt-6-astra-aeon", "gpt-daybreak-blue-latest", "gpt-daybreak-red-latest"];
|
|
9
|
+
export declare const UNESTIMATED_ROUTABLE_MODELS: readonly ["gpt-5.6-sol", "gpt-5.6-terra", "gpt-5.6-luna", "gpt-6-astra", "gpt-6-astra-aeon", "gpt-6-sol", "gpt-6-luna", "gpt-daybreak-blue-latest", "gpt-daybreak-red-latest"];
|
|
10
10
|
export interface EffectiveContextWindow {
|
|
11
11
|
tokens: number;
|
|
12
12
|
source: "override" | "estimate";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model-context-windows.d.ts","sourceRoot":"","sources":["../../../lib/context-budget/model-context-windows.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"model-context-windows.d.ts","sourceRoot":"","sources":["../../../lib/context-budget/model-context-windows.ts"],"names":[],"mappings":"AAoCA;;;;;;;GAOG;AACH,eAAO,MAAM,2BAA2B,gLAoB9B,CAAC;AAgCX,MAAM,WAAW,sBAAsB;IACtC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,UAAU,GAAG,UAAU,CAAC;CAChC;AAED;;;;;;;;GAQG;AACH,wBAAgB,yBAAyB,CACxC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAChC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,GAC3C,sBAAsB,GAAG,IAAI,CA0B/B;AAED,wBAAgB,gCAAgC,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAEzE"}
|
|
@@ -22,19 +22,14 @@ import { getNormalizedModel } from "../request/helpers/model-map.js";
|
|
|
22
22
|
* in doubt about a model's real ceiling, leave it out of this table and add
|
|
23
23
|
* it to UNESTIMATED_ROUTABLE_MODELS instead.
|
|
24
24
|
*/
|
|
25
|
+
//
|
|
26
|
+
// Retired models (`gpt-5.1` through `gpt-5.4-*`, `gpt-5-mini`/`nano`, the codex
|
|
27
|
+
// models) are deliberately absent. Their ids now route to a replacement, and
|
|
28
|
+
// estimating the window from the retired name would evaluate a request against
|
|
29
|
+
// a model it no longer runs on.
|
|
25
30
|
const ESTIMATED_MODEL_CONTEXT_WINDOWS = {
|
|
26
|
-
"gpt-5.1": 260_000,
|
|
27
|
-
"gpt-5.2": 260_000,
|
|
28
|
-
"gpt-5.2-pro": 260_000,
|
|
29
|
-
"gpt-5.3-codex": 260_000,
|
|
30
|
-
"gpt-5.4": 260_000,
|
|
31
|
-
"gpt-5.4-mini": 260_000,
|
|
32
|
-
"gpt-5.4-nano": 260_000,
|
|
33
|
-
"gpt-5.4-pro": 260_000,
|
|
34
31
|
"gpt-5.5": 260_000,
|
|
35
32
|
"gpt-5.5-pro": 260_000,
|
|
36
|
-
"gpt-5-mini": 260_000,
|
|
37
|
-
"gpt-5-nano": 260_000,
|
|
38
33
|
};
|
|
39
34
|
/**
|
|
40
35
|
* Routable models this guard consciously does not estimate a window for.
|
|
@@ -58,6 +53,10 @@ export const UNESTIMATED_ROUTABLE_MODELS = [
|
|
|
58
53
|
// `contextBudgetGuardModelWindowOverrides` once you know your real ceiling.
|
|
59
54
|
"gpt-6-astra",
|
|
60
55
|
"gpt-6-astra-aeon",
|
|
56
|
+
// Sol and Luna carry the same 272K Codex / 872K max split in the upstream
|
|
57
|
+
// catalog as Astra, so the same reasoning keeps them unestimated.
|
|
58
|
+
"gpt-6-sol",
|
|
59
|
+
"gpt-6-luna",
|
|
61
60
|
"gpt-daybreak-blue-latest",
|
|
62
61
|
"gpt-daybreak-red-latest",
|
|
63
62
|
];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codex.d.ts","sourceRoot":"","sources":["../../../lib/prompts/codex.ts"],"names":[],"mappings":"AAOA,OAAO,EAAkC,KAAK,WAAW,EAAE,MAAM,iCAAiC,CAAC;AA4EnG;;;GAGG;AACH,wBAAgB,sBAAsB,IAAI,IAAI,CAI7C;AAcD,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,YAAY,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAyBnE;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,eAAe,EAAE,MAAM,GAAG,WAAW,CAEnE;AA4ED;;;;;;;;;GASG;AACH,wBAAsB,oBAAoB,CACzC,eAAe,SAAgB,GAC7B,OAAO,CAAC,MAAM,CAAC,CAkHjB;AA6GD;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,GAAE,MAAM,EAAO,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"codex.d.ts","sourceRoot":"","sources":["../../../lib/prompts/codex.ts"],"names":[],"mappings":"AAOA,OAAO,EAAkC,KAAK,WAAW,EAAE,MAAM,iCAAiC,CAAC;AA4EnG;;;GAGG;AACH,wBAAgB,sBAAsB,IAAI,IAAI,CAI7C;AAcD,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,YAAY,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAyBnE;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,eAAe,EAAE,MAAM,GAAG,WAAW,CAEnE;AA4ED;;;;;;;;;GASG;AACH,wBAAsB,oBAAoB,CACzC,eAAe,SAAgB,GAC7B,OAAO,CAAC,MAAM,CAAC,CAkHjB;AA6GD;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,GAAE,MAAM,EAAO,GAAG,IAAI,CAmBpE;AAED;;GAEG;AACH,eAAO,MAAM,kBAAkB,ozGA+EV,CAAC"}
|
|
@@ -359,7 +359,9 @@ function refreshInstructionsInBackground(modelFamily, promptFile, cacheFile, cac
|
|
|
359
359
|
* Prewarm instruction caches for the provided models/families.
|
|
360
360
|
*/
|
|
361
361
|
export function prewarmCodexInstructions(models = []) {
|
|
362
|
-
|
|
362
|
+
// Every live model is in the gpt-5.2 prompt family now that the codex and
|
|
363
|
+
// gpt-5.1 models are retired, so the default model alone covers the prewarm.
|
|
364
|
+
const candidates = models.length > 0 ? models : [DEFAULT_MODEL];
|
|
363
365
|
const prewarmTargets = new Map();
|
|
364
366
|
for (const model of candidates) {
|
|
365
367
|
const promptFamily = getModelFamily(model);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error-classification.d.ts","sourceRoot":"","sources":["../../../lib/request/error-classification.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"error-classification.d.ts","sourceRoot":"","sources":["../../../lib/request/error-classification.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,MAAM,WAAW,gBAAgB;IACzB,aAAa,EAAE,IAAI,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACvB;AAED,sGAAsG;AACtG,eAAO,MAAM,oCAAoC,6CAA6C,CAAC;AAQ/F,eAAO,MAAM,wCAAwC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAmE7E,CAAC;AAEF,MAAM,WAAW,yBAAyB;IACzC,aAAa,EAAE,OAAO,CAAC;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,sCAAsC;IACtD,cAAc,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,SAAS,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IACnC,+BAA+B,EAAE,OAAO,CAAC;IACzC,iCAAiC,EAAE,OAAO,CAAC;IAC3C,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;CACvC;AAiDD,wBAAgB,oCAAoC,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAgBzF;AAED,sGAAsG;AACtG,wBAAgB,iCAAiC,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAQ3F;AAED,wBAAgB,4BAA4B,CAC3C,SAAS,EAAE,OAAO,GAChB,yBAAyB,CAqD3B;AAED,wBAAgB,oCAAoC,CACnD,OAAO,EAAE,sCAAsC,GAC7C,MAAM,GAAG,SAAS,CAkCpB;AAED;;GAEG;AACH,wBAAgB,uCAAuC,CACtD,cAAc,EAAE,MAAM,GAAG,SAAS,EAClC,SAAS,EAAE,OAAO,GAChB,OAAO,CAgBT;AAqCD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,sBAAsB,CACrC,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,GACd,OAAO,CAIT;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAK1E;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,wBAAwB,CAChC,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,OAAO,EACb,QAAQ,EAAE,MAAM,GACrB,OAAO,CAoDT;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,8BAA8B,CAAC,SAAS,EAAE,MAAM,GAAG,QAAQ,CAmB1E"}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { isRecord } from "../utils.js";
|
|
7
7
|
import { HTTP_STATUS, stripModelEffortSuffix } from "../constants.js";
|
|
8
|
+
import { RETIRED_MODEL_REPLACEMENTS } from "./helpers/model-map.js";
|
|
8
9
|
/** @internal Exported only for sibling lib/request modules; import via fetch-helpers.ts elsewhere. */
|
|
9
10
|
export const CHATGPT_CODEX_UNSUPPORTED_MODEL_CODE = "model_not_supported_with_chatgpt_account";
|
|
10
11
|
const CHATGPT_CODEX_UNSUPPORTED_MODEL_PATTERN = /model is not supported when using codex with a chatgpt account/i;
|
|
@@ -26,42 +27,55 @@ export const DEFAULT_UNSUPPORTED_CODEX_FALLBACK_CHAIN = {
|
|
|
26
27
|
//
|
|
27
28
|
// Depth is not free: every hop spends one of the shared per-request outbound
|
|
28
29
|
// attempts (`tryConsumeOutboundRequestAttempt`). A single-account balanced
|
|
29
|
-
// session gets a budget of 5, and the aeon walk needs
|
|
30
|
-
//
|
|
31
|
-
// the tail
|
|
32
|
-
// 503 rather than `gpt-5.
|
|
33
|
-
// lost first matters least. Do not
|
|
30
|
+
// session gets a budget of 5, and the aeon walk needs 4 (it needed all 5
|
|
31
|
+
// until `gpt-5.4` was retired as the floor), leaving one attempt for a retry
|
|
32
|
+
// or a stream failover. Spend two and the tail hop becomes unreachable,
|
|
33
|
+
// ending as an attempt-budget-exhausted 503 rather than `gpt-5.5`. Hops are
|
|
34
|
+
// ordered most-valuable-first so what is lost first matters least. Do not
|
|
35
|
+
// add a hop to a GPT-6 row without
|
|
34
36
|
// re-checking that budget; `test/gpt6-astra-models.test.ts` asserts it.
|
|
35
37
|
"gpt-6-astra": ["gpt-5.6-sol", "gpt-5.5"],
|
|
36
38
|
// aeon steps to the flagship first: still GPT-6, still Astra, just without
|
|
37
39
|
// the long-horizon behaviour.
|
|
38
40
|
"gpt-6-astra-aeon": ["gpt-6-astra", "gpt-5.6-sol"],
|
|
41
|
+
// Sol and Luna step to the 5.6 tier they replace, never sideways into Astra:
|
|
42
|
+
// an account without the new tier is far likelier to lack Astra too, and
|
|
43
|
+
// Astra is the priciest hop available ($10/$50 per 1M against Luna's
|
|
44
|
+
// $0.10/$0.50). Every hop on these walks still costs more than Luna itself.
|
|
45
|
+
"gpt-6-sol": ["gpt-5.6-sol"],
|
|
46
|
+
"gpt-6-luna": ["gpt-5.6-luna"],
|
|
39
47
|
// The hop that makes the Astra path reach a model every account has. GPT-5.6
|
|
40
48
|
// shipped without a chain entry, so an unsupported 5.6 response ended the
|
|
41
49
|
// walk; with Astra above it that would have stranded the fallback one rung
|
|
42
|
-
// short of the floor it documents.
|
|
43
|
-
// absent: nothing steps into them, so giving them a hop would change 5.6
|
|
44
|
-
// behaviour beyond completing this path.
|
|
50
|
+
// short of the floor it documents.
|
|
45
51
|
"gpt-5.6-sol": ["gpt-5.5"],
|
|
52
|
+
// Luna gained its row once `gpt-6-luna` started stepping into it; without
|
|
53
|
+
// it the Luna walk would stop one rung short of `gpt-5.5`, the same
|
|
54
|
+
// stranding the Sol row fixed. It also applies to a direct `gpt-5.6-luna`
|
|
55
|
+
// request, which used to end its walk on an unsupported response and now
|
|
56
|
+
// retries on the pricier `gpt-5.5`.
|
|
57
|
+
"gpt-5.6-luna": ["gpt-5.5"],
|
|
58
|
+
// Terra gained its row once the retired codex minis and `gpt-5-mini` began
|
|
59
|
+
// stepping into it; without it those walks stopped at Terra instead of the
|
|
60
|
+
// `gpt-5.5` floor every other retired id reaches.
|
|
61
|
+
"gpt-5.6-terra": ["gpt-5.5"],
|
|
46
62
|
"gpt-5": ["gpt-5.5"],
|
|
47
63
|
"gpt-5-pro": ["gpt-5.5-pro"],
|
|
48
|
-
"gpt-5-
|
|
49
|
-
"gpt-5.5": ["gpt-5.
|
|
50
|
-
"gpt-5.5-pro": ["gpt-5.
|
|
51
|
-
"gpt-5.5-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
"gpt-5.2-codex": ["gpt-5.3-codex"],
|
|
64
|
-
"gpt-5.1-codex": ["gpt-5.3-codex"],
|
|
64
|
+
"gpt-5.5-2026-04-23": ["gpt-5.5"],
|
|
65
|
+
"gpt-5.5-20260423": ["gpt-5.5"],
|
|
66
|
+
"gpt-5.5-pro-2026-04-23": ["gpt-5.5-pro"],
|
|
67
|
+
"gpt-5.5-pro-20260423": ["gpt-5.5-pro"],
|
|
68
|
+
// `gpt-5.5` and `gpt-5.5-pro` are the floor: they used to step to `gpt-5.4`,
|
|
69
|
+
// which the Codex backend no longer serves (`retirement_at: 2026-08-31` in
|
|
70
|
+
// the upstream catalog), so that hop could only ever fail.
|
|
71
|
+
//
|
|
72
|
+
// A retired id still reaches the backend verbatim through the pass-through
|
|
73
|
+
// rotation proxy, and the backend rejects it as unsupported. One hop to the
|
|
74
|
+
// replacement OpenAI names for it turns that into a working request.
|
|
75
|
+
...Object.fromEntries(Object.entries(RETIRED_MODEL_REPLACEMENTS).map(([retired, replacement]) => [
|
|
76
|
+
retired,
|
|
77
|
+
[replacement],
|
|
78
|
+
])),
|
|
65
79
|
};
|
|
66
80
|
function canonicalizeModelName(model) {
|
|
67
81
|
if (!model)
|
|
@@ -252,7 +252,7 @@ function normalizeErrorPayload(errorBody, bodyText, statusText, status, diagnost
|
|
|
252
252
|
error: {
|
|
253
253
|
message: `The model '${unsupportedModel}' is not currently available for this ChatGPT account when using Codex OAuth. ` +
|
|
254
254
|
"This is an account/workspace entitlement gate, not a temporary rate limit. " +
|
|
255
|
-
"Try 'gpt-5.
|
|
255
|
+
"Try 'gpt-5.6-sol' or 'gpt-5.5', or enable automatic fallback via " +
|
|
256
256
|
'unsupportedCodexPolicy: "fallback" (or CODEX_AUTH_UNSUPPORTED_MODEL_POLICY=fallback). ' +
|
|
257
257
|
"(Legacy: CODEX_AUTH_FALLBACK_UNSUPPORTED_MODEL=1 or fallbackOnUnsupportedCodexModel).",
|
|
258
258
|
type: "entitlement_error",
|
|
@@ -31,10 +31,18 @@ export interface ModelProfile {
|
|
|
31
31
|
supportedReasoningEfforts: readonly ModelReasoningEffort[];
|
|
32
32
|
capabilities: ModelCapabilities;
|
|
33
33
|
}
|
|
34
|
-
|
|
34
|
+
/**
|
|
35
|
+
* Where every codex-named id routes. No codex model is left: upstream Codex
|
|
36
|
+
* dropped `gpt-5.3-codex` from its catalog on 2026-07-08, and OpenAI's
|
|
37
|
+
* deprecations page names `gpt-5.6-sol` as the replacement for every retired
|
|
38
|
+
* codex id (`gpt-5-codex`, `gpt-5.1-codex*`, `gpt-5.2-codex`). The export
|
|
39
|
+
* keeps its name so callers that mean "the model a codex request runs on"
|
|
40
|
+
* still read naturally.
|
|
41
|
+
*/
|
|
42
|
+
export declare const CURRENT_CODEX_MODEL = "gpt-5.6-sol";
|
|
35
43
|
export declare const DEFAULT_MODEL = "gpt-5.5";
|
|
36
44
|
export declare const DEFAULT_PROBE_MODEL = "gpt-5.6-sol";
|
|
37
|
-
export declare const QUOTA_PROBE_MODEL_CHAIN: readonly ["gpt-5.6-sol", "gpt-5.5", "gpt-
|
|
45
|
+
export declare const QUOTA_PROBE_MODEL_CHAIN: readonly ["gpt-5.6-sol", "gpt-5.5", "gpt-6-luna"];
|
|
38
46
|
/**
|
|
39
47
|
* Effective model profiles keyed by canonical model name.
|
|
40
48
|
*
|
|
@@ -45,6 +53,8 @@ export declare const QUOTA_PROBE_MODEL_CHAIN: readonly ["gpt-5.6-sol", "gpt-5.5"
|
|
|
45
53
|
*/
|
|
46
54
|
export declare const MODEL_PROFILES: Record<string, ModelProfile>;
|
|
47
55
|
declare const MODEL_MAP: Record<string, string>;
|
|
56
|
+
/** Every retired id and its replacement, for diagnostics and tests. */
|
|
57
|
+
export declare const RETIRED_MODEL_REPLACEMENTS: Readonly<Record<string, string>>;
|
|
48
58
|
export { MODEL_MAP };
|
|
49
59
|
/**
|
|
50
60
|
* Get normalized model name from a known config/runtime identifier.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model-map.d.ts","sourceRoot":"","sources":["../../../../lib/request/helpers/model-map.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH,OAAO,KAAK,EACX,oBAAoB,EACpB,mBAAmB,EACnB,MAAM,oBAAoB,CAAC;AAE5B,YAAY,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,CAAC;AAE1D,MAAM,MAAM,iBAAiB,GAC1B,aAAa,GACb,WAAW,GACX,OAAO,GACP,SAAS,GACT,SAAS,CAAC;AAEb;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG,iBAAiB,CAAC;AAE5C;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,SAAS,WAAW,EAMvC,CAAC;AAEX,MAAM,WAAW,iBAAiB;IACjC,UAAU,EAAE,OAAO,CAAC;IACpB,WAAW,EAAE,OAAO,CAAC;IACrB,UAAU,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,YAAY;IAC5B,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,iBAAiB,CAAC;IAChC,sBAAsB,EAAE,oBAAoB,CAAC;IAC7C,yBAAyB,EAAE,SAAS,oBAAoB,EAAE,CAAC;IAC3D,YAAY,EAAE,iBAAiB,CAAC;CAChC;AA6CD,eAAO,MAAM,mBAAmB,
|
|
1
|
+
{"version":3,"file":"model-map.d.ts","sourceRoot":"","sources":["../../../../lib/request/helpers/model-map.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH,OAAO,KAAK,EACX,oBAAoB,EACpB,mBAAmB,EACnB,MAAM,oBAAoB,CAAC;AAE5B,YAAY,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,CAAC;AAE1D,MAAM,MAAM,iBAAiB,GAC1B,aAAa,GACb,WAAW,GACX,OAAO,GACP,SAAS,GACT,SAAS,CAAC;AAEb;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG,iBAAiB,CAAC;AAE5C;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,SAAS,WAAW,EAMvC,CAAC;AAEX,MAAM,WAAW,iBAAiB;IACjC,UAAU,EAAE,OAAO,CAAC;IACpB,WAAW,EAAE,OAAO,CAAC;IACrB,UAAU,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,YAAY;IAC5B,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,iBAAiB,CAAC;IAChC,sBAAsB,EAAE,oBAAoB,CAAC;IAC7C,yBAAyB,EAAE,SAAS,oBAAoB,EAAE,CAAC;IAC3D,YAAY,EAAE,iBAAiB,CAAC;CAChC;AA6CD;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB,gBAAgB,CAAC;AAQjD,eAAO,MAAM,aAAa,YAAY,CAAC;AAevC,eAAO,MAAM,mBAAmB,gBAAgB,CAAC;AAWjD,eAAO,MAAM,uBAAuB,mDAI1B,CAAC;AAiKX;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CA6F9C,CAAC;AAEX,QAAA,MAAM,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM,CAAC;AA4I7C,uEAAuE;AACvE,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAGvE,CAAC;AAiBF,OAAO,EAAE,SAAS,EAAE,CAAC;AA6MrB;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAQtE;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAmDxE;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,YAAY,CAavE;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,iBAAiB,CAEjF;AAeD;;;;;;;;;;;GAWG;AACH,wBAAgB,2BAA2B,CAC1C,KAAK,EAAE,MAAM,GAAG,SAAS,GACvB,mBAAmB,CASrB;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAErD"}
|