codex-multi-auth 2.0.1 → 2.0.2
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/README.md +7 -5
- package/config/README.md +4 -4
- package/config/codex-legacy.json +571 -571
- package/config/codex-modern.json +258 -258
- package/config/minimal-codex.json +1 -1
- package/dist/lib/auth/device-auth.d.ts +46 -0
- package/dist/lib/auth/device-auth.d.ts.map +1 -0
- package/dist/lib/auth/device-auth.js +325 -0
- package/dist/lib/auth/device-auth.js.map +1 -0
- package/dist/lib/auth/index.d.ts +2 -0
- package/dist/lib/auth/index.d.ts.map +1 -1
- package/dist/lib/auth/index.js +1 -0
- package/dist/lib/auth/index.js.map +1 -1
- package/dist/lib/codex-manager/help.d.ts +1 -0
- package/dist/lib/codex-manager/help.d.ts.map +1 -1
- package/dist/lib/codex-manager/help.js +18 -1
- package/dist/lib/codex-manager/help.js.map +1 -1
- package/dist/lib/codex-manager.d.ts.map +1 -1
- package/dist/lib/codex-manager.js +22 -5
- package/dist/lib/codex-manager.js.map +1 -1
- package/dist/lib/schemas.d.ts +3 -0
- package/dist/lib/schemas.d.ts.map +1 -1
- package/dist/lib/schemas.js +1 -0
- package/dist/lib/schemas.js.map +1 -1
- package/package.json +1 -1
- package/scripts/bench-format/codex-host.mjs +142 -142
- package/scripts/bench-format/models.mjs +23 -23
- package/scripts/benchmark-edit-formats.mjs +9 -9
- package/scripts/codex-app-router.js +121 -121
- package/scripts/codex.js +165 -165
package/scripts/codex.js
CHANGED
|
@@ -440,76 +440,76 @@ const NORMALIZED_UNSUPPORTED_MODEL_PATTERN =
|
|
|
440
440
|
/model ['"]([^'"]+)['"] is not currently available for this chatgpt account when using codex oauth/i;
|
|
441
441
|
const MODEL_ACCESS_DENIED_PATTERN =
|
|
442
442
|
/the model [`'"]([^`'"]+)[`'"] does not exist or you do not have access to it/i;
|
|
443
|
-
const DIRECT_UNSUPPORTED_MODEL_PATTERN =
|
|
444
|
-
/['"]([^'"]+)['"]\s+model is not supported when using codex with a chatgpt account/i;
|
|
445
|
-
const CURRENT_CODEX_MODEL = "gpt-5.3-codex";
|
|
446
|
-
const LEGACY_CODEX_MODEL = "gpt-5-codex";
|
|
447
|
-
const WRAPPER_UNSUPPORTED_MODEL_FALLBACK_CHAIN = {
|
|
448
|
-
"gpt-5": ["gpt-5.5"],
|
|
449
|
-
"gpt-5-pro": ["gpt-5.5-pro"],
|
|
450
|
-
"gpt-5-chat-latest": ["gpt-5.5"],
|
|
451
|
-
"gpt-5.5": ["gpt-5.4"],
|
|
452
|
-
"gpt-5.5-pro": ["gpt-5.4"],
|
|
453
|
-
"gpt-5.5-2026-04-23": ["gpt-5.4"],
|
|
454
|
-
"gpt-5.5-pro-2026-04-23": ["gpt-5.4"],
|
|
455
|
-
"gpt-5.5-20260423": ["gpt-5.4"],
|
|
456
|
-
"gpt-5.5-pro-20260423": ["gpt-5.4"],
|
|
457
|
-
"gpt-5.3-codex-spark": [CURRENT_CODEX_MODEL],
|
|
458
|
-
"codex-max": [CURRENT_CODEX_MODEL],
|
|
459
|
-
"gpt-5.1-codex-max": [CURRENT_CODEX_MODEL],
|
|
460
|
-
"codex-mini-latest": [CURRENT_CODEX_MODEL],
|
|
461
|
-
"gpt-5-codex-mini": [CURRENT_CODEX_MODEL],
|
|
462
|
-
"gpt-5.1-codex-mini": [CURRENT_CODEX_MODEL],
|
|
463
|
-
[LEGACY_CODEX_MODEL]: [CURRENT_CODEX_MODEL],
|
|
464
|
-
"gpt-5.2-codex": [CURRENT_CODEX_MODEL],
|
|
465
|
-
"gpt-5.1-codex": [CURRENT_CODEX_MODEL],
|
|
466
|
-
};
|
|
467
|
-
|
|
468
|
-
function canonicalizeRequestedModelName(model) {
|
|
469
|
-
if (typeof model !== "string") return "";
|
|
470
|
-
const normalizedModel = normalizeRequestedModel(model);
|
|
471
|
-
if (normalizedModel) {
|
|
472
|
-
return normalizedModel;
|
|
443
|
+
const DIRECT_UNSUPPORTED_MODEL_PATTERN =
|
|
444
|
+
/['"]([^'"]+)['"]\s+model is not supported when using codex with a chatgpt account/i;
|
|
445
|
+
const CURRENT_CODEX_MODEL = "gpt-5.3-codex";
|
|
446
|
+
const LEGACY_CODEX_MODEL = "gpt-5-codex";
|
|
447
|
+
const WRAPPER_UNSUPPORTED_MODEL_FALLBACK_CHAIN = {
|
|
448
|
+
"gpt-5": ["gpt-5.5"],
|
|
449
|
+
"gpt-5-pro": ["gpt-5.5-pro"],
|
|
450
|
+
"gpt-5-chat-latest": ["gpt-5.5"],
|
|
451
|
+
"gpt-5.5": ["gpt-5.4"],
|
|
452
|
+
"gpt-5.5-pro": ["gpt-5.4"],
|
|
453
|
+
"gpt-5.5-2026-04-23": ["gpt-5.4"],
|
|
454
|
+
"gpt-5.5-pro-2026-04-23": ["gpt-5.4"],
|
|
455
|
+
"gpt-5.5-20260423": ["gpt-5.4"],
|
|
456
|
+
"gpt-5.5-pro-20260423": ["gpt-5.4"],
|
|
457
|
+
"gpt-5.3-codex-spark": [CURRENT_CODEX_MODEL],
|
|
458
|
+
"codex-max": [CURRENT_CODEX_MODEL],
|
|
459
|
+
"gpt-5.1-codex-max": [CURRENT_CODEX_MODEL],
|
|
460
|
+
"codex-mini-latest": [CURRENT_CODEX_MODEL],
|
|
461
|
+
"gpt-5-codex-mini": [CURRENT_CODEX_MODEL],
|
|
462
|
+
"gpt-5.1-codex-mini": [CURRENT_CODEX_MODEL],
|
|
463
|
+
[LEGACY_CODEX_MODEL]: [CURRENT_CODEX_MODEL],
|
|
464
|
+
"gpt-5.2-codex": [CURRENT_CODEX_MODEL],
|
|
465
|
+
"gpt-5.1-codex": [CURRENT_CODEX_MODEL],
|
|
466
|
+
};
|
|
467
|
+
|
|
468
|
+
function canonicalizeRequestedModelName(model) {
|
|
469
|
+
if (typeof model !== "string") return "";
|
|
470
|
+
const normalizedModel = normalizeRequestedModel(model);
|
|
471
|
+
if (normalizedModel) {
|
|
472
|
+
return normalizedModel;
|
|
473
473
|
}
|
|
474
474
|
|
|
475
475
|
const stripped = stripProviderPrefix(model).trim().toLowerCase();
|
|
476
476
|
if (!stripped) {
|
|
477
477
|
return "";
|
|
478
478
|
}
|
|
479
|
-
|
|
480
|
-
return stripped.replace(/-(none|minimal|low|medium|high|xhigh)$/i, "");
|
|
481
|
-
}
|
|
482
|
-
|
|
483
|
-
function canonicalizeUnsupportedModelKey(model) {
|
|
484
|
-
if (typeof model !== "string") return "";
|
|
485
|
-
const stripped = stripProviderPrefix(model).trim().toLowerCase();
|
|
486
|
-
if (!stripped) {
|
|
487
|
-
return "";
|
|
488
|
-
}
|
|
489
|
-
return stripped.replace(/-(none|minimal|low|medium|high|xhigh)$/i, "");
|
|
490
|
-
}
|
|
491
|
-
|
|
492
|
-
function extractUnsupportedModelFromOutput(output) {
|
|
493
|
-
if (typeof output !== "string" || output.length === 0) {
|
|
494
|
-
return undefined;
|
|
495
|
-
}
|
|
496
|
-
|
|
497
|
-
const directMatch = output.match(DIRECT_UNSUPPORTED_MODEL_PATTERN);
|
|
498
|
-
if (directMatch?.[1]) {
|
|
499
|
-
return canonicalizeUnsupportedModelKey(directMatch[1]);
|
|
500
|
-
}
|
|
501
|
-
|
|
502
|
-
const normalizedMatch = output.match(NORMALIZED_UNSUPPORTED_MODEL_PATTERN);
|
|
503
|
-
if (normalizedMatch?.[1]) {
|
|
504
|
-
return canonicalizeUnsupportedModelKey(normalizedMatch[1]);
|
|
505
|
-
}
|
|
506
|
-
const accessDeniedMatch = output.match(MODEL_ACCESS_DENIED_PATTERN);
|
|
507
|
-
if (accessDeniedMatch?.[1]) {
|
|
508
|
-
return canonicalizeUnsupportedModelKey(accessDeniedMatch[1]);
|
|
509
|
-
}
|
|
510
|
-
|
|
511
|
-
return undefined;
|
|
512
|
-
}
|
|
479
|
+
|
|
480
|
+
return stripped.replace(/-(none|minimal|low|medium|high|xhigh)$/i, "");
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
function canonicalizeUnsupportedModelKey(model) {
|
|
484
|
+
if (typeof model !== "string") return "";
|
|
485
|
+
const stripped = stripProviderPrefix(model).trim().toLowerCase();
|
|
486
|
+
if (!stripped) {
|
|
487
|
+
return "";
|
|
488
|
+
}
|
|
489
|
+
return stripped.replace(/-(none|minimal|low|medium|high|xhigh)$/i, "");
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
function extractUnsupportedModelFromOutput(output) {
|
|
493
|
+
if (typeof output !== "string" || output.length === 0) {
|
|
494
|
+
return undefined;
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
const directMatch = output.match(DIRECT_UNSUPPORTED_MODEL_PATTERN);
|
|
498
|
+
if (directMatch?.[1]) {
|
|
499
|
+
return canonicalizeUnsupportedModelKey(directMatch[1]);
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
const normalizedMatch = output.match(NORMALIZED_UNSUPPORTED_MODEL_PATTERN);
|
|
503
|
+
if (normalizedMatch?.[1]) {
|
|
504
|
+
return canonicalizeUnsupportedModelKey(normalizedMatch[1]);
|
|
505
|
+
}
|
|
506
|
+
const accessDeniedMatch = output.match(MODEL_ACCESS_DENIED_PATTERN);
|
|
507
|
+
if (accessDeniedMatch?.[1]) {
|
|
508
|
+
return canonicalizeUnsupportedModelKey(accessDeniedMatch[1]);
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
return undefined;
|
|
512
|
+
}
|
|
513
513
|
|
|
514
514
|
function resolveUnsupportedModelRetryTarget(
|
|
515
515
|
requestedModel,
|
|
@@ -526,14 +526,14 @@ function resolveUnsupportedModelRetryTarget(
|
|
|
526
526
|
return undefined;
|
|
527
527
|
}
|
|
528
528
|
|
|
529
|
-
const attempted = new Set(
|
|
530
|
-
attemptedModels
|
|
531
|
-
.map((model) => canonicalizeUnsupportedModelKey(model))
|
|
532
|
-
.filter(Boolean),
|
|
533
|
-
);
|
|
534
|
-
const normalizedRequestedModel = canonicalizeUnsupportedModelKey(requestedModel);
|
|
535
|
-
const blockedModel =
|
|
536
|
-
extractUnsupportedModelFromOutput(output) ?? normalizedRequestedModel;
|
|
529
|
+
const attempted = new Set(
|
|
530
|
+
attemptedModels
|
|
531
|
+
.map((model) => canonicalizeUnsupportedModelKey(model))
|
|
532
|
+
.filter(Boolean),
|
|
533
|
+
);
|
|
534
|
+
const normalizedRequestedModel = canonicalizeUnsupportedModelKey(requestedModel);
|
|
535
|
+
const blockedModel =
|
|
536
|
+
extractUnsupportedModelFromOutput(output) ?? normalizedRequestedModel;
|
|
537
537
|
const fallbackChain =
|
|
538
538
|
WRAPPER_UNSUPPORTED_MODEL_FALLBACK_CHAIN[blockedModel] ??
|
|
539
539
|
(normalizedRequestedModel
|
|
@@ -557,11 +557,11 @@ function replaceRequestedModel(args, nextModel) {
|
|
|
557
557
|
|
|
558
558
|
const nextArgs = [...args];
|
|
559
559
|
for (let i = 0; i < nextArgs.length; i += 1) {
|
|
560
|
-
const arg = nextArgs[i];
|
|
561
|
-
if ((arg === "--model" || arg === "-m") && typeof nextArgs[i + 1] === "string") {
|
|
562
|
-
nextArgs[i + 1] = nextModel;
|
|
563
|
-
return nextArgs;
|
|
564
|
-
}
|
|
560
|
+
const arg = nextArgs[i];
|
|
561
|
+
if ((arg === "--model" || arg === "-m") && typeof nextArgs[i + 1] === "string") {
|
|
562
|
+
nextArgs[i + 1] = nextModel;
|
|
563
|
+
return nextArgs;
|
|
564
|
+
}
|
|
565
565
|
if (typeof arg === "string" && arg.startsWith("--model=")) {
|
|
566
566
|
nextArgs[i] = `--model=${nextModel}`;
|
|
567
567
|
return nextArgs;
|
|
@@ -1001,15 +1001,15 @@ function hasCliAuthCredentialsStoreOverride(args) {
|
|
|
1001
1001
|
// `lib/request/helpers/model-map.ts` `MODEL_PROFILES`
|
|
1002
1002
|
// and its GPT-5 normalization helpers.
|
|
1003
1003
|
// This wrapper runs before the TypeScript build, so it cannot import that source.
|
|
1004
|
-
const SUPPORTED_REASONING_EFFORTS_BY_MODEL = {
|
|
1005
|
-
[CURRENT_CODEX_MODEL]: ["low", "medium", "high", "xhigh"],
|
|
1006
|
-
"gpt-5.5": ["none", "low", "medium", "high", "xhigh"],
|
|
1007
|
-
"gpt-5.5-pro": ["medium", "high", "xhigh"],
|
|
1008
|
-
"gpt-5.4": ["none", "low", "medium", "high", "xhigh"],
|
|
1009
|
-
"gpt-5.4-pro": ["medium", "high", "xhigh"],
|
|
1010
|
-
"gpt-5.4-mini": ["medium"],
|
|
1011
|
-
"gpt-5.4-nano": ["medium"],
|
|
1012
|
-
"gpt-5.2-pro": ["medium", "high", "xhigh"],
|
|
1004
|
+
const SUPPORTED_REASONING_EFFORTS_BY_MODEL = {
|
|
1005
|
+
[CURRENT_CODEX_MODEL]: ["low", "medium", "high", "xhigh"],
|
|
1006
|
+
"gpt-5.5": ["none", "low", "medium", "high", "xhigh"],
|
|
1007
|
+
"gpt-5.5-pro": ["medium", "high", "xhigh"],
|
|
1008
|
+
"gpt-5.4": ["none", "low", "medium", "high", "xhigh"],
|
|
1009
|
+
"gpt-5.4-pro": ["medium", "high", "xhigh"],
|
|
1010
|
+
"gpt-5.4-mini": ["medium"],
|
|
1011
|
+
"gpt-5.4-nano": ["medium"],
|
|
1012
|
+
"gpt-5.2-pro": ["medium", "high", "xhigh"],
|
|
1013
1013
|
"gpt-5.2": ["none", "low", "medium", "high", "xhigh"],
|
|
1014
1014
|
"gpt-5.1": ["none", "low", "medium", "high"],
|
|
1015
1015
|
"gpt-5-mini": ["medium"],
|
|
@@ -1027,13 +1027,13 @@ const REASONING_FALLBACKS = {
|
|
|
1027
1027
|
|
|
1028
1028
|
const KNOWN_REASONING_EFFORTS = new Set(Object.keys(REASONING_FALLBACKS));
|
|
1029
1029
|
const REQUESTED_MODEL_ALIASES = new Map();
|
|
1030
|
-
const DEFAULT_GENERAL_GPT5_MODEL = "gpt-5.5";
|
|
1031
|
-
const GPT_5_5_CANONICAL_MODEL = "gpt-5.5";
|
|
1032
|
-
const GPT_5_5_PRO_CANONICAL_MODEL = "gpt-5.5-pro";
|
|
1033
|
-
const GPT_5_5_RELEASE_MODEL = "gpt-5.5-2026-04-23";
|
|
1034
|
-
const GPT_5_5_PRO_RELEASE_MODEL = "gpt-5.5-pro-2026-04-23";
|
|
1035
|
-
const GPT_5_5_RELEASE_COMPAT_MODEL = "gpt-5.5-20260423";
|
|
1036
|
-
const GPT_5_5_PRO_RELEASE_COMPAT_MODEL = "gpt-5.5-pro-20260423";
|
|
1030
|
+
const DEFAULT_GENERAL_GPT5_MODEL = "gpt-5.5";
|
|
1031
|
+
const GPT_5_5_CANONICAL_MODEL = "gpt-5.5";
|
|
1032
|
+
const GPT_5_5_PRO_CANONICAL_MODEL = "gpt-5.5-pro";
|
|
1033
|
+
const GPT_5_5_RELEASE_MODEL = "gpt-5.5-2026-04-23";
|
|
1034
|
+
const GPT_5_5_PRO_RELEASE_MODEL = "gpt-5.5-pro-2026-04-23";
|
|
1035
|
+
const GPT_5_5_RELEASE_COMPAT_MODEL = "gpt-5.5-20260423";
|
|
1036
|
+
const GPT_5_5_PRO_RELEASE_COMPAT_MODEL = "gpt-5.5-pro-20260423";
|
|
1037
1037
|
const GENERAL_GPT5_VERSION_CATALOG = {
|
|
1038
1038
|
1: {
|
|
1039
1039
|
base: "gpt-5.1",
|
|
@@ -1042,12 +1042,12 @@ const GENERAL_GPT5_VERSION_CATALOG = {
|
|
|
1042
1042
|
base: "gpt-5.2",
|
|
1043
1043
|
pro: "gpt-5.2-pro",
|
|
1044
1044
|
},
|
|
1045
|
-
4: {
|
|
1046
|
-
base: DEFAULT_GENERAL_GPT5_MODEL,
|
|
1047
|
-
pro: "gpt-5.4-pro",
|
|
1048
|
-
mini: "gpt-5.4-mini",
|
|
1049
|
-
nano: "gpt-5.4-nano",
|
|
1050
|
-
},
|
|
1045
|
+
4: {
|
|
1046
|
+
base: DEFAULT_GENERAL_GPT5_MODEL,
|
|
1047
|
+
pro: "gpt-5.4-pro",
|
|
1048
|
+
mini: "gpt-5.4-mini",
|
|
1049
|
+
nano: "gpt-5.4-nano",
|
|
1050
|
+
},
|
|
1051
1051
|
5: {
|
|
1052
1052
|
base: GPT_5_5_CANONICAL_MODEL,
|
|
1053
1053
|
pro: GPT_5_5_PRO_CANONICAL_MODEL,
|
|
@@ -1055,13 +1055,13 @@ const GENERAL_GPT5_VERSION_CATALOG = {
|
|
|
1055
1055
|
nano: "gpt-5-nano",
|
|
1056
1056
|
},
|
|
1057
1057
|
};
|
|
1058
|
-
const GENERAL_GPT5_STABLE_VARIANTS = GENERAL_GPT5_VERSION_CATALOG[5];
|
|
1059
|
-
const GENERAL_GPT5_GENERIC_VARIANTS = {
|
|
1060
|
-
base: DEFAULT_GENERAL_GPT5_MODEL,
|
|
1061
|
-
pro: GPT_5_5_PRO_CANONICAL_MODEL,
|
|
1062
|
-
mini: "gpt-5-mini",
|
|
1063
|
-
nano: "gpt-5-nano",
|
|
1064
|
-
};
|
|
1058
|
+
const GENERAL_GPT5_STABLE_VARIANTS = GENERAL_GPT5_VERSION_CATALOG[5];
|
|
1059
|
+
const GENERAL_GPT5_GENERIC_VARIANTS = {
|
|
1060
|
+
base: DEFAULT_GENERAL_GPT5_MODEL,
|
|
1061
|
+
pro: GPT_5_5_PRO_CANONICAL_MODEL,
|
|
1062
|
+
mini: "gpt-5-mini",
|
|
1063
|
+
nano: "gpt-5-nano",
|
|
1064
|
+
};
|
|
1065
1065
|
|
|
1066
1066
|
function addRequestedModelAlias(alias, normalizedModel) {
|
|
1067
1067
|
REQUESTED_MODEL_ALIASES.set(alias, normalizedModel);
|
|
@@ -1174,50 +1174,50 @@ function seedRequestedModelAliases() {
|
|
|
1174
1174
|
GPT_5_5_CANONICAL_MODEL,
|
|
1175
1175
|
GPT_5_5_CANONICAL_MODEL,
|
|
1176
1176
|
);
|
|
1177
|
-
addRequestedModelReasoningAliases(
|
|
1178
|
-
GPT_5_5_RELEASE_MODEL,
|
|
1179
|
-
GPT_5_5_CANONICAL_MODEL,
|
|
1180
|
-
);
|
|
1181
|
-
addRequestedModelReasoningAliases(
|
|
1182
|
-
GPT_5_5_RELEASE_COMPAT_MODEL,
|
|
1183
|
-
GPT_5_5_CANONICAL_MODEL,
|
|
1184
|
-
);
|
|
1185
1177
|
addRequestedModelReasoningAliases(
|
|
1178
|
+
GPT_5_5_RELEASE_MODEL,
|
|
1179
|
+
GPT_5_5_CANONICAL_MODEL,
|
|
1180
|
+
);
|
|
1181
|
+
addRequestedModelReasoningAliases(
|
|
1182
|
+
GPT_5_5_RELEASE_COMPAT_MODEL,
|
|
1183
|
+
GPT_5_5_CANONICAL_MODEL,
|
|
1184
|
+
);
|
|
1185
|
+
addRequestedModelReasoningAliases(
|
|
1186
|
+
GPT_5_5_PRO_CANONICAL_MODEL,
|
|
1186
1187
|
GPT_5_5_PRO_CANONICAL_MODEL,
|
|
1188
|
+
);
|
|
1189
|
+
addRequestedModelReasoningAliases(
|
|
1190
|
+
GPT_5_5_PRO_RELEASE_MODEL,
|
|
1187
1191
|
GPT_5_5_PRO_CANONICAL_MODEL,
|
|
1188
1192
|
);
|
|
1189
|
-
addRequestedModelReasoningAliases(
|
|
1190
|
-
|
|
1191
|
-
GPT_5_5_PRO_CANONICAL_MODEL,
|
|
1192
|
-
);
|
|
1193
|
-
addRequestedModelReasoningAliases(
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
);
|
|
1197
|
-
addRequestedModelReasoningAliases("gpt-5.4", "gpt-5.4");
|
|
1198
|
-
addRequestedModelReasoningAliases("gpt-5.4-pro", "gpt-5.4-pro");
|
|
1199
|
-
addRequestedModelReasoningAliases("gpt-5.4-mini", "gpt-5.4-mini");
|
|
1200
|
-
addRequestedModelReasoningAliases("gpt-5.4-nano", "gpt-5.4-nano");
|
|
1193
|
+
addRequestedModelReasoningAliases(
|
|
1194
|
+
GPT_5_5_PRO_RELEASE_COMPAT_MODEL,
|
|
1195
|
+
GPT_5_5_PRO_CANONICAL_MODEL,
|
|
1196
|
+
);
|
|
1197
|
+
addRequestedModelReasoningAliases("gpt-5.4", "gpt-5.4");
|
|
1198
|
+
addRequestedModelReasoningAliases("gpt-5.4-pro", "gpt-5.4-pro");
|
|
1199
|
+
addRequestedModelReasoningAliases("gpt-5.4-mini", "gpt-5.4-mini");
|
|
1200
|
+
addRequestedModelReasoningAliases("gpt-5.4-nano", "gpt-5.4-nano");
|
|
1201
1201
|
addRequestedModelReasoningAliases("gpt-5.2-pro", "gpt-5.2-pro");
|
|
1202
|
-
addRequestedModelReasoningAliases("gpt-5-pro", GPT_5_5_PRO_CANONICAL_MODEL);
|
|
1202
|
+
addRequestedModelReasoningAliases("gpt-5-pro", GPT_5_5_PRO_CANONICAL_MODEL);
|
|
1203
1203
|
addRequestedModelReasoningAliases("gpt-5.2", "gpt-5.2");
|
|
1204
1204
|
addRequestedModelReasoningAliases("gpt-5.1", "gpt-5.1");
|
|
1205
|
-
addRequestedModelReasoningAliases("gpt-5", DEFAULT_GENERAL_GPT5_MODEL);
|
|
1205
|
+
addRequestedModelReasoningAliases("gpt-5", DEFAULT_GENERAL_GPT5_MODEL);
|
|
1206
1206
|
addRequestedModelReasoningAliases("gpt-5-mini", "gpt-5-mini");
|
|
1207
1207
|
addRequestedModelReasoningAliases("gpt-5-nano", "gpt-5-nano");
|
|
1208
1208
|
addRequestedModelReasoningAliases("gpt-5.1-chat-latest", "gpt-5.1");
|
|
1209
|
-
addRequestedModelReasoningAliases("gpt-5-chat-latest", DEFAULT_GENERAL_GPT5_MODEL);
|
|
1210
|
-
addRequestedModelReasoningAliases(CURRENT_CODEX_MODEL, CURRENT_CODEX_MODEL);
|
|
1211
|
-
addRequestedModelReasoningAliases("gpt-5.3-codex-spark", CURRENT_CODEX_MODEL);
|
|
1212
|
-
addRequestedModelReasoningAliases(LEGACY_CODEX_MODEL, CURRENT_CODEX_MODEL);
|
|
1213
|
-
addRequestedModelReasoningAliases("gpt-5.2-codex", CURRENT_CODEX_MODEL);
|
|
1214
|
-
addRequestedModelReasoningAliases("gpt-5.1-codex", CURRENT_CODEX_MODEL);
|
|
1215
|
-
addRequestedModelAlias("gpt_5_codex", CURRENT_CODEX_MODEL);
|
|
1216
|
-
addRequestedModelReasoningAliases("codex-max", CURRENT_CODEX_MODEL);
|
|
1217
|
-
addRequestedModelReasoningAliases("gpt-5.1-codex-max", CURRENT_CODEX_MODEL);
|
|
1218
|
-
addRequestedModelAlias("codex-mini-latest", CURRENT_CODEX_MODEL);
|
|
1219
|
-
addRequestedModelReasoningAliases("gpt-5-codex-mini", CURRENT_CODEX_MODEL);
|
|
1220
|
-
addRequestedModelReasoningAliases("gpt-5.1-codex-mini", CURRENT_CODEX_MODEL);
|
|
1209
|
+
addRequestedModelReasoningAliases("gpt-5-chat-latest", DEFAULT_GENERAL_GPT5_MODEL);
|
|
1210
|
+
addRequestedModelReasoningAliases(CURRENT_CODEX_MODEL, CURRENT_CODEX_MODEL);
|
|
1211
|
+
addRequestedModelReasoningAliases("gpt-5.3-codex-spark", CURRENT_CODEX_MODEL);
|
|
1212
|
+
addRequestedModelReasoningAliases(LEGACY_CODEX_MODEL, CURRENT_CODEX_MODEL);
|
|
1213
|
+
addRequestedModelReasoningAliases("gpt-5.2-codex", CURRENT_CODEX_MODEL);
|
|
1214
|
+
addRequestedModelReasoningAliases("gpt-5.1-codex", CURRENT_CODEX_MODEL);
|
|
1215
|
+
addRequestedModelAlias("gpt_5_codex", CURRENT_CODEX_MODEL);
|
|
1216
|
+
addRequestedModelReasoningAliases("codex-max", CURRENT_CODEX_MODEL);
|
|
1217
|
+
addRequestedModelReasoningAliases("gpt-5.1-codex-max", CURRENT_CODEX_MODEL);
|
|
1218
|
+
addRequestedModelAlias("codex-mini-latest", CURRENT_CODEX_MODEL);
|
|
1219
|
+
addRequestedModelReasoningAliases("gpt-5-codex-mini", CURRENT_CODEX_MODEL);
|
|
1220
|
+
addRequestedModelReasoningAliases("gpt-5.1-codex-mini", CURRENT_CODEX_MODEL);
|
|
1221
1221
|
}
|
|
1222
1222
|
|
|
1223
1223
|
seedRequestedModelAliases();
|
|
@@ -1264,24 +1264,24 @@ function resolveStableGeneralGpt5Variant(variant) {
|
|
|
1264
1264
|
|
|
1265
1265
|
function resolveCodexRequestedModel(normalized) {
|
|
1266
1266
|
if (
|
|
1267
|
-
normalized.includes("gpt-5.1-codex-max") ||
|
|
1268
|
-
normalized.includes("gpt 5.1 codex max") ||
|
|
1269
|
-
normalized.includes("codex-max")
|
|
1270
|
-
) {
|
|
1271
|
-
return CURRENT_CODEX_MODEL;
|
|
1272
|
-
}
|
|
1267
|
+
normalized.includes("gpt-5.1-codex-max") ||
|
|
1268
|
+
normalized.includes("gpt 5.1 codex max") ||
|
|
1269
|
+
normalized.includes("codex-max")
|
|
1270
|
+
) {
|
|
1271
|
+
return CURRENT_CODEX_MODEL;
|
|
1272
|
+
}
|
|
1273
1273
|
if (
|
|
1274
1274
|
normalized.includes("gpt-5.1-codex-mini") ||
|
|
1275
1275
|
normalized.includes("gpt 5.1 codex mini") ||
|
|
1276
1276
|
normalized.includes("gpt-5-codex-mini") ||
|
|
1277
|
-
normalized.includes("gpt 5 codex mini") ||
|
|
1278
|
-
normalized.includes("codex-mini-latest")
|
|
1279
|
-
) {
|
|
1280
|
-
return CURRENT_CODEX_MODEL;
|
|
1281
|
-
}
|
|
1282
|
-
if (
|
|
1283
|
-
normalized.includes("gpt-5.3-codex-spark") ||
|
|
1284
|
-
normalized.includes("gpt 5.3 codex spark") ||
|
|
1277
|
+
normalized.includes("gpt 5 codex mini") ||
|
|
1278
|
+
normalized.includes("codex-mini-latest")
|
|
1279
|
+
) {
|
|
1280
|
+
return CURRENT_CODEX_MODEL;
|
|
1281
|
+
}
|
|
1282
|
+
if (
|
|
1283
|
+
normalized.includes("gpt-5.3-codex-spark") ||
|
|
1284
|
+
normalized.includes("gpt 5.3 codex spark") ||
|
|
1285
1285
|
normalized.includes("gpt-5.3-codex") ||
|
|
1286
1286
|
normalized.includes("gpt 5.3 codex") ||
|
|
1287
1287
|
normalized.includes("gpt-5.2-codex") ||
|
|
@@ -1289,11 +1289,11 @@ function resolveCodexRequestedModel(normalized) {
|
|
|
1289
1289
|
normalized.includes("gpt-5.1-codex") ||
|
|
1290
1290
|
normalized.includes("gpt 5.1 codex") ||
|
|
1291
1291
|
normalized.includes("gpt-5-codex") ||
|
|
1292
|
-
normalized.includes("gpt 5 codex") ||
|
|
1293
|
-
normalized === "codex"
|
|
1294
|
-
) {
|
|
1295
|
-
return CURRENT_CODEX_MODEL;
|
|
1296
|
-
}
|
|
1292
|
+
normalized.includes("gpt 5 codex") ||
|
|
1293
|
+
normalized === "codex"
|
|
1294
|
+
) {
|
|
1295
|
+
return CURRENT_CODEX_MODEL;
|
|
1296
|
+
}
|
|
1297
1297
|
|
|
1298
1298
|
return "";
|
|
1299
1299
|
}
|
|
@@ -1379,12 +1379,12 @@ function coerceReasoningEffortForModel(model, effort) {
|
|
|
1379
1379
|
}
|
|
1380
1380
|
|
|
1381
1381
|
function extractRequestedModel(args) {
|
|
1382
|
-
for (let i = 0; i < args.length; i += 1) {
|
|
1383
|
-
const arg = args[i];
|
|
1384
|
-
if (arg === "--model" || arg === "-m") {
|
|
1385
|
-
const next = args[i + 1];
|
|
1386
|
-
if (typeof next === "string" && next.trim().length > 0) {
|
|
1387
|
-
return next.trim();
|
|
1382
|
+
for (let i = 0; i < args.length; i += 1) {
|
|
1383
|
+
const arg = args[i];
|
|
1384
|
+
if (arg === "--model" || arg === "-m") {
|
|
1385
|
+
const next = args[i + 1];
|
|
1386
|
+
if (typeof next === "string" && next.trim().length > 0) {
|
|
1387
|
+
return next.trim();
|
|
1388
1388
|
}
|
|
1389
1389
|
continue;
|
|
1390
1390
|
}
|