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

Function getUserSpecifiedModelSetting

src/utils/model/model.ts:61–78  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

59 * 4. Settings (from user's saved settings)
60 */
61export function getUserSpecifiedModelSetting(): ModelSetting | undefined {
62 let specifiedModel: ModelSetting | undefined
63
64 const modelOverride = getMainLoopModelOverride()
65 if (modelOverride !== undefined) {
66 specifiedModel = modelOverride
67 } else {
68 const settings = getSettings_DEPRECATED() || {}
69 specifiedModel = process.env.ANTHROPIC_MODEL || settings.model || undefined
70 }
71
72 // Ignore the user-specified model if it's not in the availableModels allowlist.
73 if (specifiedModel && !isModelAllowed(specifiedModel)) {
74 return undefined
75 }
76
77 return specifiedModel
78}
79
80/**
81 * Get the main loop model to use for the current session.

Callers 6

runFunction · 0.85
getAvailableUpgradeFunction · 0.85
getModelOptionsFunction · 0.85
getMainLoopModelFunction · 0.85
getRuntimeMainLoopModelFunction · 0.85
isRelevantFunction · 0.85

Calls 2

getMainLoopModelOverrideFunction · 0.85
isModelAllowedFunction · 0.85

Tested by

no test coverage detected