MCPcopy Index your code
hub / github.com/Noumena-Network/code / getRuntimeMainLoopModel

Function getRuntimeMainLoopModel

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

Source from the content-addressed store, hash-verified

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

Callers 8

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

Calls 3

getDefaultOpusModelFunction · 0.85
getDefaultFlashModelFunction · 0.85

Tested by

no test coverage detected