From 57e14cf3a69e5106a0a29ffda77f8aa134aa435d Mon Sep 17 00:00:00 2001 From: Tam Nhu Tran Date: Mon, 23 Feb 2026 22:59:02 +0700 Subject: [PATCH] fix(codex): validate tier thinking values before suffixing --- src/cliproxy/config/thinking-config.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/cliproxy/config/thinking-config.ts b/src/cliproxy/config/thinking-config.ts index 76e67752..bf0dfa99 100644 --- a/src/cliproxy/config/thinking-config.ts +++ b/src/cliproxy/config/thinking-config.ts @@ -294,6 +294,16 @@ 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); } }