From db80f85e38abe7ace0c25b774cdf65ed4913b8df Mon Sep 17 00:00:00 2001 From: Tam Nhu Tran Date: Mon, 23 Feb 2026 23:10:12 +0700 Subject: [PATCH] fix(codex): preserve codex tier efforts in auto thinking --- src/cliproxy/config/thinking-config.ts | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/cliproxy/config/thinking-config.ts b/src/cliproxy/config/thinking-config.ts index bf0dfa99..5afe0b3b 100644 --- a/src/cliproxy/config/thinking-config.ts +++ b/src/cliproxy/config/thinking-config.ts @@ -124,6 +124,15 @@ export function getThinkingValueForTier( if (providerOverride) { return providerOverride; } + + // Codex effort aliases historically defaulted to xhigh/high/medium per tier. + // Preserve this behavior when settings are canonicalized (suffix-stripped). + if (provider === 'codex') { + if (tier === 'opus') return 'xhigh'; + if (tier === 'sonnet') return 'high'; + return 'medium'; + } + // Fall back to global tier default (with null guard, uses centralized defaults) return thinkingConfig.tier_defaults?.[tier] ?? DEFAULT_THINKING_TIER_DEFAULTS[tier]; } @@ -294,16 +303,6 @@ export function applyThinkingConfig( continue; } - // Validate/clamp tier thinking against this specific tier model capabilities. - const tierValidation = validateThinking(tierProvider, normalizedTierModel, tierThinkingValue); - if (tierValidation.warning && shouldShowWarnings(thinkingConfig)) { - console.warn(warn(tierValidation.warning)); - } - tierThinkingValue = tierValidation.value; - if (isThinkingOffValue(tierThinkingValue)) { - continue; - } - result[tierVar] = applyThinkingSuffixForProvider(model, tierThinkingValue, tierProvider); } }