mirror of
https://github.com/router-for-me/CLIProxyAPIPlus.git
synced 2026-04-21 07:02:05 +00:00
Improve GitLab Duo gateway compatibility
This commit is contained in:
@@ -46,3 +46,41 @@ func TestRegisterModelsForAuth_GitLabUsesDiscoveredModels(t *testing.T) {
|
||||
t.Fatalf("expected gitlab-duo and discovered model, got %+v", models)
|
||||
}
|
||||
}
|
||||
|
||||
func TestRegisterModelsForAuth_GitLabIncludesAgenticCatalog(t *testing.T) {
|
||||
service := &Service{cfg: &config.Config{}}
|
||||
auth := &coreauth.Auth{
|
||||
ID: "gitlab-agentic-auth.json",
|
||||
Provider: "gitlab",
|
||||
Status: coreauth.StatusActive,
|
||||
}
|
||||
|
||||
reg := registry.GetGlobalRegistry()
|
||||
reg.UnregisterClient(auth.ID)
|
||||
t.Cleanup(func() { reg.UnregisterClient(auth.ID) })
|
||||
|
||||
service.registerModelsForAuth(auth)
|
||||
models := reg.GetModelsForClient(auth.ID)
|
||||
if len(models) < 5 {
|
||||
t.Fatalf("expected stable alias plus built-in agentic catalog, got %d entries", len(models))
|
||||
}
|
||||
|
||||
required := map[string]bool{
|
||||
"gitlab-duo": false,
|
||||
"duo-chat-opus-4-6": false,
|
||||
"duo-chat-haiku-4-5": false,
|
||||
"duo-chat-sonnet-4-5": false,
|
||||
"duo-chat-opus-4-5": false,
|
||||
"duo-chat-gpt-5-codex": false,
|
||||
}
|
||||
for _, model := range models {
|
||||
if _, ok := required[model.ID]; ok {
|
||||
required[model.ID] = true
|
||||
}
|
||||
}
|
||||
for id, seen := range required {
|
||||
if !seen {
|
||||
t.Fatalf("expected built-in GitLab Duo model %q, got %+v", id, models)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user