fix: adjust model dialog to handle same model id but different names (#2881)
Some checks are pending
deploy / deploy (push) Waiting to run
format / format (push) Waiting to run
snapshot / publish (push) Waiting to run
test / test (push) Waiting to run

This commit is contained in:
Aiden Cline 2025-09-30 11:43:57 -05:00 committed by GitHub
parent bdac22cb07
commit fe45a76c55
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -303,7 +303,8 @@ func (m *modelDialog) buildSearchResults(query string) []list.Item {
for _, match := range matches {
model := modelMap[match.Target]
// 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] {
continue
}