Просмотр исходного кода

fix: adjust model dialog to handle same model id but different names (#2881)

Aiden Cline 4 месяцев назад
Родитель
Сommit
fe45a76c55
1 измененных файлов с 2 добавлено и 1 удалено
  1. 2 1
      packages/tui/internal/components/dialog/models.go

+ 2 - 1
packages/tui/internal/components/dialog/models.go

@@ -303,7 +303,8 @@ func (m *modelDialog) buildSearchResults(query string) []list.Item {
 	for _, match := range matches {
 	for _, match := range matches {
 		model := modelMap[match.Target]
 		model := modelMap[match.Target]
 		// Create a unique key to avoid duplicates
 		// Create a unique key to avoid duplicates
-		key := fmt.Sprintf("%s:%s", model.Provider.ID, model.Model.ID)
+		// Include name to handle custom models with same ID but different names
+		key := fmt.Sprintf("%s:%s:%s", model.Provider.ID, model.Model.ID, model.Model.Name)
 		if seenModels[key] {
 		if seenModels[key] {
 			continue
 			continue
 		}
 		}