MCPcopy Create free account
hub / github.com/oboard/claude-code-rev / getRuntimeMainLoopModel

Function getRuntimeMainLoopModel

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

Source from the content-addressed store, hash-verified

160 * @returns The model to use
161 */
162export function getRuntimeMainLoopModel(params: {
163 permissionMode: PermissionMode
164 mainLoopModel: string
165 exceeds200kTokens?: boolean
166}): ModelName {
167 const { permissionMode, mainLoopModel, exceeds200kTokens = false } = params
168
169 // opusplan uses Opus in plan mode without [1m] suffix.
170 if (
171 getUserSpecifiedModelSetting() === 'opusplan' &&
172 permissionMode === 'plan' &&
173 !exceeds200kTokens
174 ) {
175 return getDefaultOpusModel()
176 }
177
178 // sonnetplan by default
179 if (getUserSpecifiedModelSetting() === 'haiku' && permissionMode === 'plan') {
180 return getDefaultSonnetModel()
181 }
182
183 return mainLoopModel
184}
185
186/**
187 * 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