fix(playground): resolve auto group model listing (#6163)

* fix(playground): resolve auto group model listing

- merge and deduplicate available models in configured auto group order.
- reuse special usable group rules and add model filtering regression coverage.

* refactor: extract GetGroupsEnabledModels to dedupe group model expansion
This commit is contained in:
QuentinHsu
2026-07-20 18:21:24 +08:00
committed by GitHub
parent e13d4033e5
commit 4aa08f917e
4 changed files with 82 additions and 38 deletions
+1 -13
View File
@@ -245,19 +245,7 @@ func ListModels(c *gin.Context, modelType int) {
userModelNames = append(userModelNames, allowModel)
}
} else {
var models []string
if groups.tokenGroup == "auto" {
for _, autoGroup := range ownerGroups {
groupModels := model.GetGroupEnabledModels(autoGroup)
for _, g := range groupModels {
if !common.StringsContains(models, g) {
models = append(models, g)
}
}
}
} else {
models = model.GetGroupEnabledModels(ownerGroups[0])
}
models := service.GetGroupsEnabledModels(ownerGroups)
for _, modelName := range models {
if !acceptUnsetRatioModel {
if !helper.HasModelBillingConfig(modelName) {