Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 69 additions & 0 deletions internal/registry/models/models.json
Original file line number Diff line number Diff line change
Expand Up @@ -1387,6 +1387,29 @@
"xhigh"
]
}
},
{
"id": "gpt-5.5",
"object": "model",
"created": 1776902400,
"owned_by": "openai",
"type": "openai",
"display_name": "GPT 5.5",
"version": "gpt-5.5",
"description": "Frontier model for complex coding, research, and real-world work.",
"context_length": 272000,
"max_completion_tokens": 128000,
"supported_parameters": [
"tools"
],
"thinking": {
"levels": [
"low",
"medium",
"high",
"xhigh"
]
}
}
],
"codex-plus": [
Expand Down Expand Up @@ -1505,6 +1528,29 @@
"xhigh"
]
}
},
{
"id": "gpt-5.5",
"object": "model",
"created": 1776902400,
"owned_by": "openai",
"type": "openai",
"display_name": "GPT 5.5",
"version": "gpt-5.5",
"description": "Frontier model for complex coding, research, and real-world work.",
"context_length": 272000,
"max_completion_tokens": 128000,
"supported_parameters": [
"tools"
],
"thinking": {
"levels": [
"low",
"medium",
"high",
"xhigh"
]
}
}
],
"codex-pro": [
Expand Down Expand Up @@ -1623,6 +1669,29 @@
"xhigh"
]
}
},
{
"id": "gpt-5.5",
"object": "model",
"created": 1776902400,
"owned_by": "openai",
"type": "openai",
"display_name": "GPT 5.5",
"version": "gpt-5.5",
"description": "Frontier model for complex coding, research, and real-world work.",
"context_length": 272000,
"max_completion_tokens": 128000,
"supported_parameters": [
"tools"
],
"thinking": {
"levels": [
"low",
"medium",
"high",
"xhigh"
]
}
}
],
"kimi": [
Expand Down
88 changes: 88 additions & 0 deletions sdk/cliproxy/service_oauth_models_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
package cliproxy

import (
"strings"
"testing"

"github.com/router-for-me/CLIProxyAPI/v6/internal/registry"
coreauth "github.com/router-for-me/CLIProxyAPI/v6/sdk/cliproxy/auth"
"github.com/router-for-me/CLIProxyAPI/v6/sdk/config"
)

func TestRegisterModelsForAuth_CodexOAuthPlanTypesExposeGPT55(t *testing.T) {
tests := []struct {
name string
planType string
wantModel bool
}{
{name: "pro", planType: "pro", wantModel: true},
{name: "plus", planType: "plus", wantModel: true},
{name: "team", planType: "team", wantModel: true},
{name: "business", planType: "business", wantModel: true},
{name: "go", planType: "go", wantModel: true},
{name: "free", planType: "free", wantModel: false},
}

for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
service := &Service{cfg: &config.Config{}}
authID := "auth-codex-" + tt.planType
reg := registry.GetGlobalRegistry()
reg.UnregisterClient(authID)
t.Cleanup(func() {
reg.UnregisterClient(authID)
})

service.registerModelsForAuth(&coreauth.Auth{
ID: authID,
Provider: "codex",
Status: coreauth.StatusActive,
Attributes: map[string]string{
"auth_kind": "oauth",
"plan_type": tt.planType,
},
})

models := reg.GetModelsForClient(authID)
if hasModelID(models, "gpt-5.5") != tt.wantModel {
t.Fatalf("plan_type=%q gpt-5.5 presence = %v, want %v", tt.planType, hasModelID(models, "gpt-5.5"), tt.wantModel)
}
})
}
}

func TestRegisterModelsForAuth_ClaudeOAuthIncludesOpus47(t *testing.T) {
service := &Service{cfg: &config.Config{}}
authID := "auth-claude-opus-47"
reg := registry.GetGlobalRegistry()
reg.UnregisterClient(authID)
t.Cleanup(func() {
reg.UnregisterClient(authID)
})

service.registerModelsForAuth(&coreauth.Auth{
ID: authID,
Provider: "claude",
Status: coreauth.StatusActive,
Attributes: map[string]string{
"auth_kind": "oauth",
},
})

models := reg.GetModelsForClient(authID)
if !hasModelID(models, "claude-opus-4-7") {
t.Fatalf("expected claude OAuth models to include %q", "claude-opus-4-7")
}
}

func hasModelID(models []*registry.ModelInfo, want string) bool {
for _, model := range models {
if model == nil {
continue
}
if strings.EqualFold(strings.TrimSpace(model.ID), want) {
return true
}
}
return false
}
Loading