From 034cc7f118f5aacd622bcf69c86ae56811aee4e7 Mon Sep 17 00:00:00 2001 From: "Apple\\Apple" Date: Fri, 13 Jun 2025 13:03:06 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(ability):=20keep=20case-sens?= =?UTF-8?q?itive=20(group,=20model)=20keys=20during=20deduplication?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The previous patch lower-cased `group` and `model` when building the temporary `abilitySet` used to prevent duplicate inserts. This merged models that differ only by letter case, e.g. `GPT-3.5-turbo` vs `gpt-3.5-turbo`, causing them to disappear from the user’s available-models list and pricing page. Change: • ability.go – removed all `strings.ToLower` calls when composing the deduplication key (`group|model`), so duplicates are checked in a case-sensitive manner while preserving the original data. Result: • `GPT-3.5-turbo` and `gpt-3.5-turbo` are now treated as distinct models throughout the system. --- model/ability.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/model/ability.go b/model/ability.go index 5c01ff7d..4300b5eb 100644 --- a/model/ability.go +++ b/model/ability.go @@ -137,7 +137,7 @@ func (channel *Channel) AddAbilities() error { abilities := make([]Ability, 0, len(models_)) for _, model := range models_ { for _, group := range groups_ { - key := strings.ToLower(group) + "|" + strings.ToLower(model) + key := group + "|" + model if _, exists := abilitySet[key]; exists { continue } @@ -204,7 +204,7 @@ func (channel *Channel) UpdateAbilities(tx *gorm.DB) error { abilities := make([]Ability, 0, len(models_)) for _, model := range models_ { for _, group := range groups_ { - key := strings.ToLower(group) + "|" + strings.ToLower(model) + key := group + "|" + model if _, exists := abilitySet[key]; exists { continue }