MCPcopy Index your code
hub / github.com/codeaashu/claude-code / resolveAppliedEffort

Function resolveAppliedEffort

src/utils/effort.ts:152–167  ·  view source on GitHub ↗
(
  model: string,
  appStateEffortValue: EffortValue | undefined,
)

Source from the content-addressed store, hash-verified

150 * 'unset', or no default exists for the model).
151 */
152export function resolveAppliedEffort(
153 model: string,
154 appStateEffortValue: EffortValue | undefined,
155): EffortValue | undefined {
156 const envOverride = getEffortEnvOverride()
157 if (envOverride === null) {
158 return undefined
159 }
160 const resolved =
161 envOverride ?? appStateEffortValue ?? getDefaultEffortForModel(model)
162 // API rejects 'max' on non-Opus-4.6 models — downgrade to 'high'.
163 if (resolved === 'max' && !modelSupportsMaxEffort(model)) {
164 return 'high'
165 }
166 return resolved
167}
168
169/**
170 * Resolve the effort level to show the user. Wraps resolveAppliedEffort

Callers 4

getDisplayedEffortLevelFunction · 0.85
getEffortSuffixFunction · 0.85
runHeadlessStreamingFunction · 0.85
queryModelFunction · 0.85

Calls 3

getEffortEnvOverrideFunction · 0.85
getDefaultEffortForModelFunction · 0.85
modelSupportsMaxEffortFunction · 0.85

Tested by

no test coverage detected