MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / getRuntimeMainLoopModel

Function getRuntimeMainLoopModel

source code/utils/model/model.ts:147–169  ·  view source on GitHub ↗
(params: {
  permissionMode: PermissionMode
  mainLoopModel: string
  exceeds200kTokens?: boolean
})

Source from the content-addressed store, hash-verified

145 * @returns The model to use
146 */
147export function getRuntimeMainLoopModel(params: {
148 permissionMode: PermissionMode
149 mainLoopModel: string
150 exceeds200kTokens?: boolean
151}): ModelName {
152 const { permissionMode, mainLoopModel, exceeds200kTokens = false } = params
153
154 // opusplan uses Opus in plan mode without [1m] suffix.
155 if (
156 getUserSpecifiedModelSetting() === 'opusplan' &&
157 permissionMode === 'plan' &&
158 !exceeds200kTokens
159 ) {
160 return getDefaultOpusModel()
161 }
162
163 // sonnetplan by default
164 if (getUserSpecifiedModelSetting() === 'haiku' && permissionMode === 'plan') {
165 return getDefaultSonnetModel()
166 }
167
168 return mainLoopModel
169}
170
171/**
172 * Get the default main loop model setting.

Callers 5

queryLoopFunction · 0.85
getContextUsedPercentFunction · 0.85
analyzeContextUsageFunction · 0.85
getAgentModelFunction · 0.85

Calls 3

getDefaultOpusModelFunction · 0.85
getDefaultSonnetModelFunction · 0.85

Tested by

no test coverage detected