MCPcopy
hub / github.com/claude-code-best/claude-code / getRuntimeMainLoopModel

Function getRuntimeMainLoopModel

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

Source from the content-addressed store, hash-verified

225 * @returns The model to use
226 */
227export function getRuntimeMainLoopModel(params: {
228 permissionMode: PermissionMode
229 mainLoopModel: string
230 exceeds200kTokens?: boolean
231}): ModelName {
232 const { permissionMode, mainLoopModel, exceeds200kTokens = false } = params
233
234 // opusplan uses Opus in plan mode without [1m] suffix.
235 if (
236 getUserSpecifiedModelSetting() === 'opusplan' &&
237 permissionMode === 'plan' &&
238 !exceeds200kTokens
239 ) {
240 return getDefaultOpusModel()
241 }
242
243 // sonnetplan by default
244 if (getUserSpecifiedModelSetting() === 'haiku' && permissionMode === 'plan') {
245 return getDefaultSonnetModel()
246 }
247
248 return mainLoopModel
249}
250
251/**
252 * Get the default main loop model setting.

Callers 6

queryLoopFunction · 0.85
StatusLineInnerFunction · 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