feat(models): add Gemini 3 Flash Preview and improve model search

- Add gemini-3-flash-preview to Google and Gemini CLI providers
- Use name field from supported-models.json when available
- Improve model search to match both display names and model IDs
This commit is contained in:
Ralph Khreish
2025-12-18 20:55:09 +01:00
parent 4d1ed20345
commit 8067d767a3
6 changed files with 62 additions and 17 deletions

View File

@@ -0,0 +1,5 @@
---
"task-master-ai": patch
---
Improved model search in `task-master models --setup` to match both display names and model IDs

View File

@@ -0,0 +1,5 @@
---
"task-master-ai": minor
---
Added Gemini 3 Flash Preview model support for Google and Gemini CLI providers

View File

@@ -158,9 +158,15 @@ export function createSearchSource(
const filteredChoices = choices.filter((choice) => {
// Separators are always included
if (choice instanceof Separator) return true;
// Filter regular choices by search term
const searchText = (choice as ModelChoice).name || '';
return searchText.toLowerCase().includes(searchTerm.toLowerCase());
// Filter regular choices by search term (name and model ID)
const mc = choice as ModelChoice;
const displayText = mc.name || '';
const modelId =
typeof mc.value === 'object' && mc.value !== null && 'id' in mc.value
? mc.value.id
: '';
const searchText = `${displayText} ${modelId}`.toLowerCase();
return searchText.includes(searchTerm.toLowerCase());
});
// Map ModelChoice to the format inquirer expects
return Promise.resolve(

View File

@@ -18,6 +18,7 @@ export interface ModelCost {
export interface ModelData {
id: string;
name?: string;
provider?: string;
swe_score?: number | null;
cost_per_1m_tokens?: ModelCost | null;

View File

@@ -1044,24 +1044,28 @@ function getAvailableModels() {
models
.filter((modelObj) => Boolean(modelObj.supported))
.forEach((modelObj) => {
// Basic name generation - can be improved
const modelId = modelObj.id;
const sweScore = modelObj.swe_score;
const cost = modelObj.cost_per_1m_tokens;
const allowedRoles = modelObj.allowed_roles || ['main', 'fallback'];
const nameParts = modelId
.split('-')
.map((p) => p.charAt(0).toUpperCase() + p.slice(1));
// Handle specific known names better if needed
let name = nameParts.join(' ');
if (modelId === 'claude-3.5-sonnet-20240620')
name = 'Claude 3.5 Sonnet';
if (modelId === 'claude-3-7-sonnet-20250219')
name = 'Claude 3.7 Sonnet';
if (modelId === 'gpt-4o') name = 'GPT-4o';
if (modelId === 'gpt-4-turbo') name = 'GPT-4 Turbo';
if (modelId === 'sonar-pro') name = 'Perplexity Sonar Pro';
if (modelId === 'sonar-mini') name = 'Perplexity Sonar Mini';
// Use name from JSON if available, otherwise generate from ID
let name = modelObj.name;
if (!name) {
const nameParts = modelId
.split('-')
.map((p) => p.charAt(0).toUpperCase() + p.slice(1));
name = nameParts.join(' ');
// Handle specific known names better if needed
if (modelId === 'claude-3.5-sonnet-20240620')
name = 'Claude 3.5 Sonnet';
if (modelId === 'claude-3-7-sonnet-20250219')
name = 'Claude 3.7 Sonnet';
if (modelId === 'gpt-4o') name = 'GPT-4o';
if (modelId === 'gpt-4-turbo') name = 'GPT-4 Turbo';
if (modelId === 'sonar-pro') name = 'Perplexity Sonar Pro';
if (modelId === 'sonar-mini') name = 'Perplexity Sonar Mini';
}
available.push({
id: modelId,

View File

@@ -202,6 +202,18 @@
}
],
"gemini-cli": [
{
"id": "gemini-3-flash-preview",
"name": "Gemini 3 Flash",
"swe_score": 0,
"cost_per_1m_tokens": {
"input": 0,
"output": 0
},
"allowed_roles": ["main", "fallback", "research"],
"max_tokens": 1048576,
"supported": true
},
{
"id": "gemini-3-pro-preview",
"swe_score": 0.762,
@@ -482,6 +494,18 @@
}
],
"google": [
{
"id": "gemini-3-flash-preview",
"name": "Gemini 3 Flash",
"swe_score": 0,
"cost_per_1m_tokens": {
"input": 0.5,
"output": 3.0
},
"allowed_roles": ["main", "fallback"],
"max_tokens": 1048576,
"supported": true
},
{
"id": "gemini-3-pro-preview",
"swe_score": 0.762,