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

Function modelSupportsEffort

src/utils/effort.ts:23–49  ·  view source on GitHub ↗
(model: string)

Source from the content-addressed store, hash-verified

21
22// @[MODEL LAUNCH]: Add the new model to the allowlist if it supports the effort parameter.
23export function modelSupportsEffort(model: string): boolean {
24 const m = model.toLowerCase()
25 if (isEnvTruthy(process.env.CLAUDE_CODE_ALWAYS_ENABLE_EFFORT)) {
26 return true
27 }
28 const supported3P = get3PModelCapabilityOverride(model, 'effort')
29 if (supported3P !== undefined) {
30 return supported3P
31 }
32 // Supported by a subset of Claude 4 models
33 if (m.includes('opus-4-6') || m.includes('sonnet-4-6')) {
34 return true
35 }
36 // Exclude any other known legacy models (haiku, older opus/sonnet variants)
37 if (m.includes('haiku') || m.includes('sonnet') || m.includes('opus')) {
38 return false
39 }
40
41 // IMPORTANT: Do not change the default effort support without notifying
42 // the model launch DRI and research. This is a sensitive setting that can
43 // greatly affect model quality and bashing.
44
45 // Default to true for unknown model strings on 1P.
46 // Do not default to true for 3P as they have different formats for their
47 // model strings (ex. anthropics/claude-code#30795)
48 return getAPIProvider() === 'firstParty'
49}
50
51// @[MODEL LAUNCH]: Add the new model to the allowlist if it supports 'max' effort.
52// Per API docs, 'max' is Opus 4.6 only for public models — other models return an error.

Callers 6

ModelPickerFunction · 0.85
getDefaultEffortForModelFunction · 0.85
runHeadlessStreamingFunction · 0.85
configureEffortParamsFunction · 0.85
tipRegistry.tsFile · 0.85

Calls 2

isEnvTruthyFunction · 0.85
getAPIProviderFunction · 0.85

Tested by

no test coverage detected