(model: string)
| 113 | |
| 114 | // @[MODEL LAUNCH]: Add the new model to the allowlist if it supports adaptive thinking. |
| 115 | export function modelSupportsAdaptiveThinking(model: string): boolean { |
| 116 | const supported3P = get3PModelCapabilityOverride(model, 'adaptive_thinking') |
| 117 | if (supported3P !== undefined) { |
| 118 | return supported3P |
| 119 | } |
| 120 | const canonical = getCanonicalName(model) |
| 121 | // Supported by a subset of Claude 4 models |
| 122 | if (canonical.includes('opus-4-6') || canonical.includes('sonnet-4-6')) { |
| 123 | return true |
| 124 | } |
| 125 | // Exclude any other known legacy models (allowlist above catches 4-6 variants first) |
| 126 | if ( |
| 127 | canonical.includes('opus') || |
| 128 | canonical.includes('sonnet') || |
| 129 | canonical.includes('haiku') |
| 130 | ) { |
| 131 | return false |
| 132 | } |
| 133 | // IMPORTANT: Do not change adaptive thinking support without notifying the |
| 134 | // model launch DRI and research. This can greatly affect model quality and |
| 135 | // bashing. |
| 136 | |
| 137 | // Newer models (4.6+) are all trained on adaptive thinking and MUST have it |
| 138 | // enabled for model testing. DO NOT default to false for first party, otherwise |
| 139 | // we may silently degrade model quality. |
| 140 | |
| 141 | // Default to true for unknown model strings on 1P and Foundry (because Foundry |
| 142 | // is a proxy). Do not default to true for other 3P as they have different formats |
| 143 | // for their model strings. |
| 144 | const provider = getAPIProvider() |
| 145 | return provider === 'firstParty' || provider === 'foundry' |
| 146 | } |
| 147 | |
| 148 | export function shouldEnableThinkingByDefault(): boolean { |
| 149 | if (process.env.MAX_THINKING_TOKENS) { |
no test coverage detected