codex-multi-auth 2.17.3 → 2.18.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/scripts/codex.js CHANGED
@@ -1405,12 +1405,25 @@ const DIRECT_UNSUPPORTED_MODEL_PATTERN =
1405
1405
  const CURRENT_CODEX_MODEL = "gpt-5.6-sol";
1406
1406
  const CODEX_MINI_REPLACEMENT_MODEL = "gpt-5.6-terra";
1407
1407
  const RETIRED_MODEL_REPLACEMENTS = {
1408
+ // `gpt-6-astra-aeon` never appeared in the bundled Codex catalog or the
1409
+ // public model docs — a Statsig-flag leak, now dead — so it aliases the
1410
+ // flagship it was a variant of.
1411
+ "gpt-6-astra-aeon": "gpt-6-astra",
1412
+ // `gpt-5.5` leaves ChatGPT/Codex OAuth on 2026-10-14 (the catalog names
1413
+ // GPT-6 Sol as the migration target); `gpt-5.5-pro` left the bundled
1414
+ // catalog earlier and is API-only, so it goes to the frontier flagship.
1415
+ "gpt-5.5": "gpt-6-sol",
1416
+ "gpt-5.5-2026-04-23": "gpt-6-sol",
1417
+ "gpt-5.5-20260423": "gpt-6-sol",
1418
+ "gpt-5.5-pro": "gpt-6-astra",
1419
+ "gpt-5.5-pro-2026-04-23": "gpt-6-astra",
1420
+ "gpt-5.5-pro-20260423": "gpt-6-astra",
1408
1421
  "gpt-5.4": "gpt-6-sol",
1409
1422
  "gpt-5.4-mini": "gpt-6-luna",
1410
1423
  "gpt-5.4-nano": "gpt-6-luna",
1411
- "gpt-5.4-pro": "gpt-5.5-pro",
1424
+ "gpt-5.4-pro": "gpt-6-astra",
1412
1425
  "gpt-5.2": "gpt-5.6-sol",
1413
- "gpt-5.2-pro": "gpt-5.5-pro",
1426
+ "gpt-5.2-pro": "gpt-6-astra",
1414
1427
  "gpt-5.1": "gpt-5.6-sol",
1415
1428
  "gpt-5-mini": "gpt-5.6-terra",
1416
1429
  "gpt-5-nano": "gpt-5.6-luna",
@@ -1429,30 +1442,26 @@ const RETIRED_MODEL_REPLACEMENTS = {
1429
1442
  "gpt-5-codex-mini": CODEX_MINI_REPLACEMENT_MODEL,
1430
1443
  "codex-mini-latest": CODEX_MINI_REPLACEMENT_MODEL,
1431
1444
  };
1432
- // Mirrors the GPT-6 rows of lib/request/error-classification.ts
1445
+ // Mirrors lib/request/error-classification.ts
1433
1446
  // `DEFAULT_UNSUPPORTED_CODEX_FALLBACK_CHAIN`. This table is walked differently
1434
1447
  // from lib's: `resolveUnsupportedModelRetryTarget` keys on the model named in
1435
1448
  // the error output and falls back to the original requested model, with
1436
1449
  // `attemptedModels` accumulating, so a row's later entries ARE reachable here.
1437
- // The two tables are not identical today (`gpt-5.3-codex` has a row in lib and
1438
- // not here), which predates GPT-6 and is left alone; the GPT-6 rows are pinned
1439
- // in parity by test/codex-model-resolution.test.ts.
1450
+ // The explicit rows and the retired-id spread are pinned in parity by
1451
+ // test/codex-model-resolution.test.ts; `gpt-6-luna` closes the general walks
1452
+ // because it ships on the most plans of any catalog model.
1440
1453
  const WRAPPER_UNSUPPORTED_MODEL_FALLBACK_CHAIN = {
1441
- "gpt-6-astra": ["gpt-5.6-sol", "gpt-5.5"],
1442
- "gpt-6-astra-aeon": ["gpt-6-astra", "gpt-5.6-sol"],
1454
+ "gpt-6.1-sol": ["gpt-6-sol"],
1455
+ "gpt-6-astra": ["gpt-6-sol"],
1443
1456
  "gpt-6-sol": ["gpt-5.6-sol"],
1444
1457
  "gpt-6-luna": ["gpt-5.6-luna"],
1445
- "gpt-5.6-sol": ["gpt-5.5"],
1446
- "gpt-5.6-luna": ["gpt-5.5"],
1447
- "gpt-5.6-terra": ["gpt-5.5"],
1448
- "gpt-5": ["gpt-5.5"],
1449
- "gpt-5-pro": ["gpt-5.5-pro"],
1450
- "gpt-5.5-2026-04-23": ["gpt-5.5"],
1451
- "gpt-5.5-20260423": ["gpt-5.5"],
1452
- "gpt-5.5-pro-2026-04-23": ["gpt-5.5-pro"],
1453
- "gpt-5.5-pro-20260423": ["gpt-5.5-pro"],
1454
- // `gpt-5.5`/`gpt-5.5-pro` are the floor; `gpt-5.4` is retired. A retired id
1455
- // steps once to its replacement.
1458
+ "gpt-5.6-sol": ["gpt-6-luna"],
1459
+ "gpt-5.6-luna": ["gpt-5.6-sol"],
1460
+ "gpt-5.6-terra": ["gpt-5.6-sol"],
1461
+ "gpt-5": ["gpt-5.6-sol"],
1462
+ "gpt-5-pro": ["gpt-6-astra"],
1463
+ // A retired id still reaches the backend verbatim and is rejected; one hop
1464
+ // to its named replacement turns that into a working request.
1456
1465
  ...Object.fromEntries(
1457
1466
  Object.entries(RETIRED_MODEL_REPLACEMENTS).map(([retired, replacement]) => [
1458
1467
  retired,
@@ -2068,7 +2077,11 @@ async function forwardToRealCodex(codexBin, rawArgs, baseEnv = process.env) {
2068
2077
  let lastExitCode = 1;
2069
2078
  const attemptedModels = new Set();
2070
2079
 
2071
- for (let attempt = 0; attempt < 4; attempt += 1) {
2080
+ // Five forwards: the deepest supported-model staircase (gpt-6.1-sol ->
2081
+ // gpt-6-sol -> gpt-5.6-sol -> gpt-6-luna -> gpt-5.6-luna) spends exactly
2082
+ // the shared per-request attempt budget of 5 the plugin host uses. With 4
2083
+ // the terminal model was unreachable from the new default.
2084
+ for (let attempt = 0; attempt < 5; attempt += 1) {
2072
2085
  const requestedModel = extractRequestedModel(currentArgs);
2073
2086
  if (requestedModel) {
2074
2087
  attemptedModels.add(requestedModel);
@@ -2169,7 +2182,7 @@ function hasCliAuthCredentialsStoreOverride(args) {
2169
2182
  // This wrapper runs before the TypeScript build, so it cannot import that source.
2170
2183
  const SUPPORTED_REASONING_EFFORTS_BY_MODEL = {
2171
2184
  "gpt-6-astra": ["low", "medium", "high", "xhigh", "max", "ultra"],
2172
- "gpt-6-astra-aeon": ["low", "medium", "high", "xhigh", "max", "ultra"],
2185
+ "gpt-6.1-sol": ["low", "medium", "high", "xhigh", "max", "ultra"],
2173
2186
  "gpt-6-sol": ["low", "medium", "high", "xhigh", "max", "ultra"],
2174
2187
  "gpt-6-luna": ["low", "medium", "high", "xhigh", "max"],
2175
2188
  "gpt-daybreak-blue-latest": ["low", "medium", "high", "xhigh", "max", "ultra"],
@@ -2177,8 +2190,6 @@ const SUPPORTED_REASONING_EFFORTS_BY_MODEL = {
2177
2190
  "gpt-5.6-sol": ["low", "medium", "high", "xhigh", "max", "ultra"],
2178
2191
  "gpt-5.6-terra": ["low", "medium", "high", "xhigh", "max", "ultra"],
2179
2192
  "gpt-5.6-luna": ["low", "medium", "high", "xhigh", "max"],
2180
- "gpt-5.5": ["none", "low", "medium", "high", "xhigh"],
2181
- "gpt-5.5-pro": ["medium", "high", "xhigh"],
2182
2193
  };
2183
2194
 
2184
2195
  const REASONING_FALLBACKS = {
@@ -2209,13 +2220,9 @@ const REASONING_ALIAS_VARIANTS = [
2209
2220
  "xhigh",
2210
2221
  ];
2211
2222
  const REQUESTED_MODEL_ALIASES = new Map();
2212
- const DEFAULT_GENERAL_GPT5_MODEL = "gpt-5.5";
2213
- const GPT_5_5_CANONICAL_MODEL = "gpt-5.5";
2214
- const GPT_5_5_PRO_CANONICAL_MODEL = "gpt-5.5-pro";
2215
- const GPT_5_5_RELEASE_MODEL = "gpt-5.5-2026-04-23";
2216
- const GPT_5_5_PRO_RELEASE_MODEL = "gpt-5.5-pro-2026-04-23";
2217
- const GPT_5_5_RELEASE_COMPAT_MODEL = "gpt-5.5-20260423";
2218
- const GPT_5_5_PRO_RELEASE_COMPAT_MODEL = "gpt-5.5-pro-20260423";
2223
+ // The general GPT-5 landing spot: with 5.5 retired, the newest living 5.x
2224
+ // flagship is 5.6 Sol. Mirrors lib/request/helpers/model-map.ts.
2225
+ const DEFAULT_GENERAL_GPT5_MODEL = "gpt-5.6-sol";
2219
2226
  // GPT-5.6 tiers. Sol and Terra expose `ultra`; Luna stops at `max`. No tier
2220
2227
  // accepts `none`/`minimal`. Bare `gpt-5.6` aliases to the flagship (Sol).
2221
2228
  const GPT_5_6_SOL_MODEL = "gpt-5.6-sol";
@@ -2224,11 +2231,11 @@ const GPT_5_6_LUNA_MODEL = "gpt-5.6-luna";
2224
2231
  const GPT_5_6_FLAGSHIP_ALIAS = "gpt-5.6";
2225
2232
  const GPT_5_6_SOL_TERRA_EFFORTS = ["low", "medium", "high", "xhigh", "max", "ultra"];
2226
2233
  const GPT_5_6_LUNA_EFFORTS = ["low", "medium", "high", "xhigh", "max"];
2227
- // GPT-6 Astra (2026-09-03): the flagship plus `aeon`, a long-horizon variant.
2228
- // Same frontier effort ladder as 5.6 (no `none`/`minimal`, `ultra` at the
2229
- // top). Bare `gpt-6` -> flagship.
2234
+ // GPT-6 Astra (2026-09-03): the frontier flagship. Same frontier effort
2235
+ // ladder as 5.6 (no `none`/`minimal`, `ultra` at the top). Bare `gpt-6` ->
2236
+ // flagship. The leaked `aeon` long-horizon variant was never catalog-listed
2237
+ // and is retired; its ids alias the flagship.
2230
2238
  const GPT_6_ASTRA_MODEL = "gpt-6-astra";
2231
- const GPT_6_ASTRA_AEON_MODEL = "gpt-6-astra-aeon";
2232
2239
  const GPT_6_FLAGSHIP_ALIAS = "gpt-6";
2233
2240
  const GPT_6_ASTRA_EFFORTS = ["low", "medium", "high", "xhigh", "max", "ultra"];
2234
2241
  // GPT-6 Sol and Luna (upstream catalog, 2026-09-22). Sol reaches `ultra`, Luna
@@ -2237,6 +2244,12 @@ const GPT_6_SOL_MODEL = "gpt-6-sol";
2237
2244
  const GPT_6_LUNA_MODEL = "gpt-6-luna";
2238
2245
  const GPT_6_SOL_EFFORTS = GPT_6_ASTRA_EFFORTS;
2239
2246
  const GPT_6_LUNA_EFFORTS = ["low", "medium", "high", "xhigh", "max"];
2247
+ // GPT-6.1 Sol (upstream catalog, 2026-09-29): the first 6.1 release, added as
2248
+ // the catalog's default model. Sol is the only 6.1 tier yet, so bare `gpt-6.1`
2249
+ // aliases to it, matching the bare-alias convention.
2250
+ const GPT_6_1_SOL_MODEL = "gpt-6.1-sol";
2251
+ const GPT_6_1_FLAGSHIP_ALIAS = "gpt-6.1";
2252
+ const GPT_6_1_SOL_EFFORTS = GPT_6_ASTRA_EFFORTS;
2240
2253
  // Daybreak cyber models from the upstream Codex catalog. `red` is the
2241
2254
  // cyber-permissive variant, `blue` the defensive one.
2242
2255
  const DAYBREAK_BLUE_MODEL = "gpt-daybreak-blue-latest";
@@ -2246,29 +2259,37 @@ const DAYBREAK_EFFORTS = ["low", "medium", "high", "xhigh", "max", "ultra"];
2246
2259
  const GENERAL_GPT5_VERSION_CATALOG = {
2247
2260
  1: {
2248
2261
  base: GPT_5_6_SOL_MODEL,
2249
- pro: GPT_5_5_PRO_CANONICAL_MODEL,
2262
+ pro: GPT_6_ASTRA_MODEL,
2250
2263
  },
2251
2264
  2: {
2252
2265
  base: GPT_5_6_SOL_MODEL,
2253
- pro: GPT_5_5_PRO_CANONICAL_MODEL,
2266
+ pro: GPT_6_ASTRA_MODEL,
2254
2267
  },
2255
2268
  4: {
2256
2269
  base: GPT_6_SOL_MODEL,
2257
- pro: GPT_5_5_PRO_CANONICAL_MODEL,
2270
+ pro: GPT_6_ASTRA_MODEL,
2258
2271
  mini: GPT_6_LUNA_MODEL,
2259
2272
  nano: GPT_6_LUNA_MODEL,
2260
2273
  },
2261
2274
  5: {
2262
- base: GPT_5_5_CANONICAL_MODEL,
2263
- pro: GPT_5_5_PRO_CANONICAL_MODEL,
2275
+ base: GPT_6_SOL_MODEL,
2276
+ pro: GPT_6_ASTRA_MODEL,
2264
2277
  mini: GPT_5_6_TERRA_MODEL,
2265
2278
  nano: GPT_5_6_LUNA_MODEL,
2266
2279
  },
2267
2280
  };
2268
- const GENERAL_GPT5_STABLE_VARIANTS = GENERAL_GPT5_VERSION_CATALOG[5];
2281
+ // Unknown future 5.x minors land on the newest generation the line still
2282
+ // serves — deliberately NOT `gpt-6-sol`, since an id naming a 5.x minor keeps
2283
+ // its generation. Mirrors lib GENERAL_GPT5_STABLE_VARIANTS.
2284
+ const GENERAL_GPT5_STABLE_VARIANTS = {
2285
+ base: GPT_5_6_SOL_MODEL,
2286
+ pro: GPT_6_ASTRA_MODEL,
2287
+ mini: GPT_5_6_TERRA_MODEL,
2288
+ nano: GPT_5_6_LUNA_MODEL,
2289
+ };
2269
2290
  const GENERAL_GPT5_GENERIC_VARIANTS = {
2270
2291
  base: DEFAULT_GENERAL_GPT5_MODEL,
2271
- pro: GPT_5_5_PRO_CANONICAL_MODEL,
2292
+ pro: GPT_6_ASTRA_MODEL,
2272
2293
  mini: GPT_5_6_TERRA_MODEL,
2273
2294
  nano: GPT_5_6_LUNA_MODEL,
2274
2295
  };
@@ -2390,31 +2411,10 @@ function renameFileWithRetry(sourcePath, destinationPath, expectedDestinationSta
2390
2411
  }
2391
2412
 
2392
2413
  function seedRequestedModelAliases() {
2393
- addRequestedModelReasoningAliases(
2394
- GPT_5_5_CANONICAL_MODEL,
2395
- GPT_5_5_CANONICAL_MODEL,
2396
- );
2397
- addRequestedModelReasoningAliases(
2398
- GPT_5_5_RELEASE_MODEL,
2399
- GPT_5_5_CANONICAL_MODEL,
2400
- );
2401
- addRequestedModelReasoningAliases(
2402
- GPT_5_5_RELEASE_COMPAT_MODEL,
2403
- GPT_5_5_CANONICAL_MODEL,
2404
- );
2405
- addRequestedModelReasoningAliases(
2406
- GPT_5_5_PRO_CANONICAL_MODEL,
2407
- GPT_5_5_PRO_CANONICAL_MODEL,
2408
- );
2409
- addRequestedModelReasoningAliases(
2410
- GPT_5_5_PRO_RELEASE_MODEL,
2411
- GPT_5_5_PRO_CANONICAL_MODEL,
2412
- );
2413
- addRequestedModelReasoningAliases(
2414
- GPT_5_5_PRO_RELEASE_COMPAT_MODEL,
2415
- GPT_5_5_PRO_CANONICAL_MODEL,
2416
- );
2417
- addRequestedModelReasoningAliases("gpt-5-pro", GPT_5_5_PRO_CANONICAL_MODEL);
2414
+ // `gpt-5` and `gpt-5-pro` are the last un-versioned ids upstream published;
2415
+ // with 5.5 retired the 5.x flagship is Sol 5.6 and the pro tier is Astra.
2416
+ // 5.5's own dated and suffixed forms come from the retired table below.
2417
+ addRequestedModelReasoningAliases("gpt-5-pro", GPT_6_ASTRA_MODEL);
2418
2418
  addRequestedModelReasoningAliases("gpt-5", DEFAULT_GENERAL_GPT5_MODEL);
2419
2419
  addRequestedModelEffortAliases(
2420
2420
  GPT_5_6_SOL_MODEL,
@@ -2441,20 +2441,18 @@ function seedRequestedModelAliases() {
2441
2441
  GPT_6_ASTRA_MODEL,
2442
2442
  GPT_6_ASTRA_EFFORTS,
2443
2443
  );
2444
- addRequestedModelEffortAliases(
2445
- GPT_6_ASTRA_AEON_MODEL,
2446
- GPT_6_ASTRA_AEON_MODEL,
2447
- GPT_6_ASTRA_EFFORTS,
2448
- );
2449
2444
  addRequestedModelEffortAliases(
2450
2445
  GPT_6_FLAGSHIP_ALIAS,
2451
2446
  GPT_6_ASTRA_MODEL,
2452
2447
  GPT_6_ASTRA_EFFORTS,
2453
2448
  );
2454
2449
  addRequestedModelEffortAliases("astra", GPT_6_ASTRA_MODEL, GPT_6_ASTRA_EFFORTS);
2450
+ // `astra-aeon` was only ever a leaked slug and is retired now, so the name
2451
+ // resolves to the flagship. Its `gpt-6-astra-aeon` form comes from the
2452
+ // retired table, not from a dedicated registration.
2455
2453
  addRequestedModelEffortAliases(
2456
2454
  "astra-aeon",
2457
- GPT_6_ASTRA_AEON_MODEL,
2455
+ GPT_6_ASTRA_MODEL,
2458
2456
  GPT_6_ASTRA_EFFORTS,
2459
2457
  );
2460
2458
  // No bare `sol`/`luna` aliases: those already mean the 5.6 tiers.
@@ -2464,6 +2462,16 @@ function seedRequestedModelAliases() {
2464
2462
  GPT_6_LUNA_MODEL,
2465
2463
  GPT_6_LUNA_EFFORTS,
2466
2464
  );
2465
+ addRequestedModelEffortAliases(
2466
+ GPT_6_1_SOL_MODEL,
2467
+ GPT_6_1_SOL_MODEL,
2468
+ GPT_6_1_SOL_EFFORTS,
2469
+ );
2470
+ addRequestedModelEffortAliases(
2471
+ GPT_6_1_FLAGSHIP_ALIAS,
2472
+ GPT_6_1_SOL_MODEL,
2473
+ GPT_6_1_SOL_EFFORTS,
2474
+ );
2467
2475
  addRequestedModelEffortAliases(
2468
2476
  DAYBREAK_BLUE_MODEL,
2469
2477
  DAYBREAK_BLUE_MODEL,
@@ -2556,23 +2564,28 @@ function resolveCodexRequestedModel(normalized) {
2556
2564
  // Resolve GPT-6 identifiers that are not exact aliases (a dated snapshot, the
2557
2565
  // `gpt-6-astra-pro` plan tier, or a tier OpenAI adds later). Without this the
2558
2566
  // general GPT-5 resolver never matches (it needs a `gpt 5` token pair) and the
2559
- // id falls through to 5.5 — running GPT-5.5 for a caller who asked for the
2560
- // frontier model. `aeon` keeps its own id because it is a behaviourally
2561
- // different model, not a rename. Mirrors lib/request/helpers/model-map.ts.
2567
+ // id falls through to the default — running 6.1 Sol for a caller who asked for
2568
+ // a different model. `aeon` resolves to the flagship it was a leaked variant
2569
+ // of. Mirrors lib/request/helpers/model-map.ts.
2562
2570
  function resolveGpt6RequestedModel(stripped) {
2563
2571
  const tokens = tokenizeRequestedModel(stripped);
2564
2572
  const gptIndex = tokens.indexOf("gpt");
2565
- // `gpt6` with no separator tokenizes as one token, so the `gpt` + `6` pair
2566
- // never forms; mirror lib and claim it here.
2567
2573
  const versionToken = gptIndex === -1 ? undefined : tokens[gptIndex + 1];
2568
2574
  // `gpt6` with no separator tokenizes as one token, so the `gpt` + `6` pair
2569
2575
  // never forms; mirror lib and claim it here.
2570
- const isGpt6 = versionToken === "6" || tokens.includes("gpt6");
2576
+ const gpt6Index = tokens.indexOf("gpt6");
2577
+ const isGpt6 = versionToken === "6" || gpt6Index !== -1;
2578
+ // A 6.1 minor shows up as the token after `6` (`gpt-6.1-sol`) or after
2579
+ // `gpt6` (`gpt6.1-sol`); both forms land on the 6.1 generation, not on the
2580
+ // 6.0 tier the trailing `sol`/`luna` tokens name.
2581
+ const isGpt61 =
2582
+ (isGpt6 && gptIndex !== -1 && tokens[gptIndex + 2] === "1") ||
2583
+ (gpt6Index !== -1 && tokens[gpt6Index + 1] === "1");
2571
2584
  // A bare `astra` token counts too: picker labels and OpenAI's own material
2572
2585
  // say "Astra" with no `gpt-6` prefix, so `Astra Pro` arrives with no version
2573
- // tokens and would otherwise miss every branch and land on 5.5. Anchored so
2574
- // an id naming a different GPT major version, `gpt-4-astra-x`, is not
2575
- // claimed for the frontier model.
2586
+ // tokens and would otherwise miss every branch and land on the default.
2587
+ // Anchored so an id naming a different GPT major version, `gpt-4-astra-x`,
2588
+ // is not claimed for the frontier model.
2576
2589
  const namesOtherGptVersion =
2577
2590
  versionToken !== undefined &&
2578
2591
  /^\d+$/.test(versionToken) &&
@@ -2581,8 +2594,10 @@ function resolveGpt6RequestedModel(stripped) {
2581
2594
  if ((!isGpt6 && !isAstra) || tokens.includes("codex")) {
2582
2595
  return "";
2583
2596
  }
2584
- if (tokens.includes("aeon")) return GPT_6_ASTRA_AEON_MODEL;
2597
+ if (tokens.includes("aeon")) return GPT_6_ASTRA_MODEL;
2585
2598
  if (isAstra) return GPT_6_ASTRA_MODEL;
2599
+ // Every unrecognised 6.1 id resolves to the generation's only tier, Sol.
2600
+ if (isGpt61) return GPT_6_1_SOL_MODEL;
2586
2601
  // `terra` goes to Sol: there is no GPT-6 Terra, and upstream migrates
2587
2602
  // `gpt-5.6-terra` users to Sol.
2588
2603
  if (tokens.includes("luna")) return GPT_6_LUNA_MODEL;