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

Function getDefaultEffortForModel

src/utils/effort.ts:279–329  ·  view source on GitHub ↗
(
  model: string,
)

Source from the content-addressed store, hash-verified

277
278// @[MODEL LAUNCH]: Update the default effort levels for new models
279export function getDefaultEffortForModel(
280 model: string,
281): EffortValue | undefined {
282 if (process.env.USER_TYPE === 'ant') {
283 const config = getAntModelOverrideConfig()
284 const isDefaultModel =
285 config?.defaultModel !== undefined &&
286 model.toLowerCase() === config.defaultModel.toLowerCase()
287 if (isDefaultModel && config?.defaultModelEffortLevel) {
288 return config.defaultModelEffortLevel
289 }
290 const antModel = resolveAntModel(model)
291 if (antModel) {
292 if (antModel.defaultEffortLevel) {
293 return antModel.defaultEffortLevel
294 }
295 if (antModel.defaultEffortValue !== undefined) {
296 return antModel.defaultEffortValue
297 }
298 }
299 // Always default ants to undefined/high
300 return undefined
301 }
302
303 // IMPORTANT: Do not change the default effort level without notifying
304 // the model launch DRI and research. Default effort is a sensitive setting
305 // that can greatly affect model quality and bashing.
306
307 // Default effort on Opus 4.6 to medium for Pro.
308 // Max/Team also get medium when the tengu_grey_step2 config is enabled.
309 if (model.toLowerCase().includes('opus-4-6')) {
310 if (isProSubscriber()) {
311 return 'medium'
312 }
313 if (
314 getOpusDefaultEffortConfig().enabled &&
315 (isMaxSubscriber() || isTeamSubscriber())
316 ) {
317 return 'medium'
318 }
319 }
320
321 // When ultrathink feature is on, default effort to medium (ultrathink bumps to high)
322 if (isUltrathinkEnabled() && modelSupportsEffort(model)) {
323 return 'medium'
324 }
325
326 // Fallback to undefined, which means we don't set an effort level. This
327 // should resolve to high effort level in the API.
328 return undefined
329}
330

Callers 3

EffortCalloutFunction · 0.85
resolveAppliedEffortFunction · 0.85

Calls 8

resolveAntModelFunction · 0.85
isProSubscriberFunction · 0.85
isMaxSubscriberFunction · 0.85
isTeamSubscriberFunction · 0.85
isUltrathinkEnabledFunction · 0.85
modelSupportsEffortFunction · 0.85

Tested by

no test coverage detected