fix(codex): preserve codex tier efforts in auto thinking

This commit is contained in:
Tam Nhu Tran
2026-02-23 23:10:12 +07:00
parent 57e14cf3a6
commit db80f85e38
+9 -10
View File
@@ -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);
}
}