(fastMode = false)
| 280 | // @[MODEL LAUNCH]: Update the model picker lists below to include/reorder options for the new model. |
| 281 | // Each user tier (ant, Max/Team Premium, Pro/Team Standard/Enterprise, PAYG 1P, PAYG 3P) has its own list. |
| 282 | function getModelOptionsBase(fastMode = false): ModelOption[] { |
| 283 | const currentCustomProvider = readCurrentCustomApiProvider() |
| 284 | const allCustomProviders = readCustomApiProvidersStorage().providers ?? [] |
| 285 | const allProviderOptions = allCustomProviders.flatMap((provider, index) => { |
| 286 | const configuredModel = provider.model?.trim() |
| 287 | const savedModels = (provider.savedModels ?? []).map(model => model.trim()).filter(Boolean) |
| 288 | const orderedModels = [ |
| 289 | ...(configuredModel ? [configuredModel] : []), |
| 290 | ...savedModels.filter(model => model !== configuredModel), |
| 291 | ] |
| 292 | return orderedModels.map(model => ({ |
| 293 | value: model, |
| 294 | label: model, |
| 295 | description: `${provider.name?.trim() || 'Provider'} · ${formatCustomApiProviderIndex(index)} · ${formatCustomApiProviderType(provider.provider)}`, |
| 296 | providerId: provider.id, |
| 297 | })) |
| 298 | }) |
| 299 | |
| 300 | if (allProviderOptions.length > 0) { |
| 301 | return allProviderOptions |
| 302 | } |
| 303 | |
| 304 | const customConfiguredModel = |
| 305 | currentCustomProvider?.model?.trim() || process.env.ANTHROPIC_MODEL?.trim() |
| 306 | const savedModels = (currentCustomProvider?.savedModels ?? []) |
| 307 | .map(model => model.trim()) |
| 308 | .filter(Boolean) |
| 309 | const customModelDescription = currentCustomProvider?.name?.trim() || 'Custom model' |
| 310 | |
| 311 | if (customConfiguredModel || savedModels.length > 0) { |
| 312 | const orderedModels = [ |
| 313 | ...(customConfiguredModel ? [customConfiguredModel] : []), |
| 314 | ...savedModels.filter(model => model !== customConfiguredModel), |
| 315 | ] |
| 316 | return [ |
| 317 | ...orderedModels.map(model => ({ |
| 318 | value: model, |
| 319 | label: model, |
| 320 | description: customModelDescription, |
| 321 | })), |
| 322 | ] |
| 323 | } |
| 324 | if (process.env.USER_TYPE === 'ant') { |
| 325 | // Build options from antModels config |
| 326 | const antModelOptions: ModelOption[] = getAntModels().map(m => ({ |
| 327 | value: m.alias, |
| 328 | label: m.label, |
| 329 | description: m.description ?? `[ANT-ONLY] ${m.label} (${m.model})`, |
| 330 | })) |
| 331 | |
| 332 | return [ |
| 333 | getDefaultOptionForUser(), |
| 334 | ...antModelOptions, |
| 335 | getMergedOpus1MOption(fastMode), |
| 336 | getSonnet46Option(), |
| 337 | getSonnet46_1MOption(), |
| 338 | getHaiku45Option(), |
| 339 | ] |
no test coverage detected