MCPcopy
hub / github.com/codeaashu/claude-code / modelSupportsAdaptiveThinking

Function modelSupportsAdaptiveThinking

src/utils/thinking.ts:113–144  ·  view source on GitHub ↗
(model: string)

Source from the content-addressed store, hash-verified

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

Callers 2

runHeadlessStreamingFunction · 0.85
paramsFromContextFunction · 0.85

Calls 2

getCanonicalNameFunction · 0.85
getAPIProviderFunction · 0.85

Tested by

no test coverage detected