Skip to content

Commit fec44f6

Browse files
committed
fix: clarify gpt-5 alias comments and pro coercion logs
1 parent 2da2411 commit fec44f6

1 file changed

Lines changed: 10 additions & 8 deletions

File tree

lib/request/request-transformer.ts

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -547,8 +547,8 @@ export function getReasoningConfig(
547547
// - OpenAI API docs: "gpt-5.1 defaults to none, supports: none, low, medium, high"
548548
// - GPT-5.4 latest model docs list reasoning controls for the base model family
549549
// - GPT-5.4 Mini should stay aligned with GPT-5.4 reasoning support as a first-class model
550-
// - Legacy lightweight aliases like gpt-5-mini/gpt-5-nano stay distinct and do not inherit
551-
// full "none" support from their gpt-5.4 normalization target
550+
// - Legacy aliases like gpt-5-mini/gpt-5-nano now resolve to first-class
551+
// GPT-5.4 Mini / GPT-5.4 Nano models, so they inherit the same "none" support
552552
// - Codex CLI: ReasoningEffort enum includes None variant (codex-rs/protocol/src/openai_models.rs)
553553
// - Codex CLI: docs/config.md lists "none" as valid for model_reasoning_effort
554554
// - gpt-5.2 and gpt-5.4 general models support: none, low, medium, high, xhigh
@@ -565,10 +565,8 @@ export function getReasoningConfig(
565565
// for better coding assistance unless user explicitly requests "none".
566566
// - Canonical GPT-5 Codex defaults to high in stable Codex.
567567
// - Legacy GPT-5.3/5.2 Codex aliases default to xhigh for backward compatibility.
568-
// - Legacy lightweight aliases (gpt-5-mini / gpt-5-nano) intentionally keep a
569-
// minimal default based on the original alias, even though normalization maps
570-
// them to gpt-5.4 which supports higher efforts. Explicit xhigh requests are
571-
// still honored below via supportsRequestedXhigh.
568+
// - Legacy gpt-5-mini / gpt-5-nano aliases now resolve to GPT-5.4 Mini / Nano,
569+
// so they inherit the same default "high" effort and direct xhigh support.
572570
const defaultEffort: ReasoningConfig["effort"] = isCodexMini
573571
? "medium"
574572
: isGpt5Codex
@@ -583,6 +581,7 @@ export function getReasoningConfig(
583581

584582
// Get user-requested effort
585583
let effort = userConfig.reasoningEffort || defaultEffort;
584+
const originalRequestedEffort = userConfig.reasoningEffort ?? defaultEffort;
586585

587586
if (isCodexMini) {
588587
if (effort === "minimal" || effort === "low" || effort === "none") {
@@ -597,7 +596,8 @@ export function getReasoningConfig(
597596
}
598597

599598
// For models that don't support xhigh, downgrade to high
600-
// Legacy aliases like gpt-5-mini/gpt-5-nano normalize to gpt-5.4, which supports xhigh.
599+
// Legacy gpt-5-mini/gpt-5-nano aliases now normalize to GPT-5.4 Mini / Nano,
600+
// both of which support xhigh directly.
601601
const supportsRequestedXhigh = supportsXhigh || canonicalSupportsXhigh;
602602
if (!supportsRequestedXhigh && effort === "xhigh") {
603603
effort = "high";
@@ -611,7 +611,9 @@ export function getReasoningConfig(
611611

612612
// GPT-5.4 Pro only supports medium/high/xhigh reasoning
613613
if (isGpt54Pro && effort === "low") {
614-
logWarn("GPT-5.4 Pro supports medium/high/xhigh only; coercing 'low' to 'medium'");
614+
logWarn(
615+
`GPT-5.4 Pro supports medium/high/xhigh only; coercing '${originalRequestedEffort}' to 'medium'`,
616+
);
615617
effort = "medium";
616618
}
617619

0 commit comments

Comments
 (0)