|
|
|
@@ -215,10 +215,10 @@ func TestManagerExecuteCount_OpenAICompatAliasPoolStopsOnInvalidRequest(t *testi
|
|
|
|
|
invalidErr := &Error{HTTPStatus: http.StatusUnprocessableEntity, Message: "unprocessable entity"}
|
|
|
|
|
executor := &openAICompatPoolExecutor{
|
|
|
|
|
id: "pool",
|
|
|
|
|
countErrors: map[string]error{"qwen3.5-plus": invalidErr},
|
|
|
|
|
countErrors: map[string]error{"deepseek-v3.1": invalidErr},
|
|
|
|
|
}
|
|
|
|
|
m := newOpenAICompatPoolTestManager(t, alias, []internalconfig.OpenAICompatibilityModel{
|
|
|
|
|
{Name: "qwen3.5-plus", Alias: alias},
|
|
|
|
|
{Name: "deepseek-v3.1", Alias: alias},
|
|
|
|
|
{Name: "glm-5", Alias: alias},
|
|
|
|
|
}, executor)
|
|
|
|
|
|
|
|
|
@@ -227,18 +227,18 @@ func TestManagerExecuteCount_OpenAICompatAliasPoolStopsOnInvalidRequest(t *testi
|
|
|
|
|
t.Fatalf("execute count error = %v, want %v", err, invalidErr)
|
|
|
|
|
}
|
|
|
|
|
got := executor.CountModels()
|
|
|
|
|
if len(got) != 1 || got[0] != "qwen3.5-plus" {
|
|
|
|
|
if len(got) != 1 || got[0] != "deepseek-v3.1" {
|
|
|
|
|
t.Fatalf("count calls = %v, want only first invalid model", got)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
func TestResolveModelAliasPoolFromConfigModels(t *testing.T) {
|
|
|
|
|
models := []modelAliasEntry{
|
|
|
|
|
internalconfig.OpenAICompatibilityModel{Name: "qwen3.5-plus", Alias: "claude-opus-4.66"},
|
|
|
|
|
internalconfig.OpenAICompatibilityModel{Name: "deepseek-v3.1", Alias: "claude-opus-4.66"},
|
|
|
|
|
internalconfig.OpenAICompatibilityModel{Name: "glm-5", Alias: "claude-opus-4.66"},
|
|
|
|
|
internalconfig.OpenAICompatibilityModel{Name: "kimi-k2.5", Alias: "claude-opus-4.66"},
|
|
|
|
|
}
|
|
|
|
|
got := resolveModelAliasPoolFromConfigModels("claude-opus-4.66(8192)", models)
|
|
|
|
|
want := []string{"qwen3.5-plus(8192)", "glm-5(8192)", "kimi-k2.5(8192)"}
|
|
|
|
|
want := []string{"deepseek-v3.1(8192)", "glm-5(8192)", "kimi-k2.5(8192)"}
|
|
|
|
|
if len(got) != len(want) {
|
|
|
|
|
t.Fatalf("pool len = %d, want %d (%v)", len(got), len(want), got)
|
|
|
|
|
}
|
|
|
|
@@ -253,7 +253,7 @@ func TestManagerExecute_OpenAICompatAliasPoolRotatesWithinAuth(t *testing.T) {
|
|
|
|
|
alias := "claude-opus-4.66"
|
|
|
|
|
executor := &openAICompatPoolExecutor{id: "pool"}
|
|
|
|
|
m := newOpenAICompatPoolTestManager(t, alias, []internalconfig.OpenAICompatibilityModel{
|
|
|
|
|
{Name: "qwen3.5-plus", Alias: alias},
|
|
|
|
|
{Name: "deepseek-v3.1", Alias: alias},
|
|
|
|
|
{Name: "glm-5", Alias: alias},
|
|
|
|
|
}, executor)
|
|
|
|
|
|
|
|
|
@@ -268,7 +268,7 @@ func TestManagerExecute_OpenAICompatAliasPoolRotatesWithinAuth(t *testing.T) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
got := executor.ExecuteModels()
|
|
|
|
|
want := []string{"qwen3.5-plus", "glm-5", "qwen3.5-plus"}
|
|
|
|
|
want := []string{"deepseek-v3.1", "glm-5", "deepseek-v3.1"}
|
|
|
|
|
if len(got) != len(want) {
|
|
|
|
|
t.Fatalf("execute calls = %v, want %v", got, want)
|
|
|
|
|
}
|
|
|
|
@@ -284,10 +284,10 @@ func TestManagerExecute_OpenAICompatAliasPoolStopsOnBadRequest(t *testing.T) {
|
|
|
|
|
invalidErr := &Error{HTTPStatus: http.StatusBadRequest, Message: "invalid_request_error: malformed payload"}
|
|
|
|
|
executor := &openAICompatPoolExecutor{
|
|
|
|
|
id: "pool",
|
|
|
|
|
executeErrors: map[string]error{"qwen3.5-plus": invalidErr},
|
|
|
|
|
executeErrors: map[string]error{"deepseek-v3.1": invalidErr},
|
|
|
|
|
}
|
|
|
|
|
m := newOpenAICompatPoolTestManager(t, alias, []internalconfig.OpenAICompatibilityModel{
|
|
|
|
|
{Name: "qwen3.5-plus", Alias: alias},
|
|
|
|
|
{Name: "deepseek-v3.1", Alias: alias},
|
|
|
|
|
{Name: "glm-5", Alias: alias},
|
|
|
|
|
}, executor)
|
|
|
|
|
|
|
|
|
@@ -296,7 +296,7 @@ func TestManagerExecute_OpenAICompatAliasPoolStopsOnBadRequest(t *testing.T) {
|
|
|
|
|
t.Fatalf("execute error = %v, want %v", err, invalidErr)
|
|
|
|
|
}
|
|
|
|
|
got := executor.ExecuteModels()
|
|
|
|
|
if len(got) != 1 || got[0] != "qwen3.5-plus" {
|
|
|
|
|
if len(got) != 1 || got[0] != "deepseek-v3.1" {
|
|
|
|
|
t.Fatalf("execute calls = %v, want only first invalid model", got)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@@ -309,10 +309,10 @@ func TestManagerExecute_OpenAICompatAliasPoolFallsBackOnModelSupportBadRequest(t
|
|
|
|
|
}
|
|
|
|
|
executor := &openAICompatPoolExecutor{
|
|
|
|
|
id: "pool",
|
|
|
|
|
executeErrors: map[string]error{"qwen3.5-plus": modelSupportErr},
|
|
|
|
|
executeErrors: map[string]error{"deepseek-v3.1": modelSupportErr},
|
|
|
|
|
}
|
|
|
|
|
m := newOpenAICompatPoolTestManager(t, alias, []internalconfig.OpenAICompatibilityModel{
|
|
|
|
|
{Name: "qwen3.5-plus", Alias: alias},
|
|
|
|
|
{Name: "deepseek-v3.1", Alias: alias},
|
|
|
|
|
{Name: "glm-5", Alias: alias},
|
|
|
|
|
}, executor)
|
|
|
|
|
|
|
|
|
@@ -324,7 +324,7 @@ func TestManagerExecute_OpenAICompatAliasPoolFallsBackOnModelSupportBadRequest(t
|
|
|
|
|
t.Fatalf("payload = %q, want %q", string(resp.Payload), "glm-5")
|
|
|
|
|
}
|
|
|
|
|
got := executor.ExecuteModels()
|
|
|
|
|
want := []string{"qwen3.5-plus", "glm-5"}
|
|
|
|
|
want := []string{"deepseek-v3.1", "glm-5"}
|
|
|
|
|
if len(got) != len(want) {
|
|
|
|
|
t.Fatalf("execute calls = %v, want %v", got, want)
|
|
|
|
|
}
|
|
|
|
@@ -338,7 +338,7 @@ func TestManagerExecute_OpenAICompatAliasPoolFallsBackOnModelSupportBadRequest(t
|
|
|
|
|
if !ok || updated == nil {
|
|
|
|
|
t.Fatalf("expected auth to remain registered")
|
|
|
|
|
}
|
|
|
|
|
state := updated.ModelStates["qwen3.5-plus"]
|
|
|
|
|
state := updated.ModelStates["deepseek-v3.1"]
|
|
|
|
|
if state == nil {
|
|
|
|
|
t.Fatalf("expected suspended upstream model state")
|
|
|
|
|
}
|
|
|
|
@@ -355,10 +355,10 @@ func TestManagerExecute_OpenAICompatAliasPoolFallsBackOnModelSupportUnprocessabl
|
|
|
|
|
}
|
|
|
|
|
executor := &openAICompatPoolExecutor{
|
|
|
|
|
id: "pool",
|
|
|
|
|
executeErrors: map[string]error{"qwen3.5-plus": modelSupportErr},
|
|
|
|
|
executeErrors: map[string]error{"deepseek-v3.1": modelSupportErr},
|
|
|
|
|
}
|
|
|
|
|
m := newOpenAICompatPoolTestManager(t, alias, []internalconfig.OpenAICompatibilityModel{
|
|
|
|
|
{Name: "qwen3.5-plus", Alias: alias},
|
|
|
|
|
{Name: "deepseek-v3.1", Alias: alias},
|
|
|
|
|
{Name: "glm-5", Alias: alias},
|
|
|
|
|
}, executor)
|
|
|
|
|
|
|
|
|
@@ -370,7 +370,7 @@ func TestManagerExecute_OpenAICompatAliasPoolFallsBackOnModelSupportUnprocessabl
|
|
|
|
|
t.Fatalf("payload = %q, want %q", string(resp.Payload), "glm-5")
|
|
|
|
|
}
|
|
|
|
|
got := executor.ExecuteModels()
|
|
|
|
|
want := []string{"qwen3.5-plus", "glm-5"}
|
|
|
|
|
want := []string{"deepseek-v3.1", "glm-5"}
|
|
|
|
|
if len(got) != len(want) {
|
|
|
|
|
t.Fatalf("execute calls = %v, want %v", got, want)
|
|
|
|
|
}
|
|
|
|
@@ -385,10 +385,10 @@ func TestManagerExecute_OpenAICompatAliasPoolFallsBackWithinSameAuth(t *testing.
|
|
|
|
|
alias := "claude-opus-4.66"
|
|
|
|
|
executor := &openAICompatPoolExecutor{
|
|
|
|
|
id: "pool",
|
|
|
|
|
executeErrors: map[string]error{"qwen3.5-plus": &Error{HTTPStatus: http.StatusTooManyRequests, Message: "quota"}},
|
|
|
|
|
executeErrors: map[string]error{"deepseek-v3.1": &Error{HTTPStatus: http.StatusTooManyRequests, Message: "quota"}},
|
|
|
|
|
}
|
|
|
|
|
m := newOpenAICompatPoolTestManager(t, alias, []internalconfig.OpenAICompatibilityModel{
|
|
|
|
|
{Name: "qwen3.5-plus", Alias: alias},
|
|
|
|
|
{Name: "deepseek-v3.1", Alias: alias},
|
|
|
|
|
{Name: "glm-5", Alias: alias},
|
|
|
|
|
}, executor)
|
|
|
|
|
|
|
|
|
@@ -400,7 +400,7 @@ func TestManagerExecute_OpenAICompatAliasPoolFallsBackWithinSameAuth(t *testing.
|
|
|
|
|
t.Fatalf("payload = %q, want %q", string(resp.Payload), "glm-5")
|
|
|
|
|
}
|
|
|
|
|
got := executor.ExecuteModels()
|
|
|
|
|
want := []string{"qwen3.5-plus", "glm-5"}
|
|
|
|
|
want := []string{"deepseek-v3.1", "glm-5"}
|
|
|
|
|
for i := range want {
|
|
|
|
|
if got[i] != want[i] {
|
|
|
|
|
t.Fatalf("execute call %d model = %q, want %q", i, got[i], want[i])
|
|
|
|
@@ -413,11 +413,11 @@ func TestManagerExecuteStream_OpenAICompatAliasPoolRetriesOnEmptyBootstrap(t *te
|
|
|
|
|
executor := &openAICompatPoolExecutor{
|
|
|
|
|
id: "pool",
|
|
|
|
|
streamPayloads: map[string][]cliproxyexecutor.StreamChunk{
|
|
|
|
|
"qwen3.5-plus": {},
|
|
|
|
|
"deepseek-v3.1": {},
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
m := newOpenAICompatPoolTestManager(t, alias, []internalconfig.OpenAICompatibilityModel{
|
|
|
|
|
{Name: "qwen3.5-plus", Alias: alias},
|
|
|
|
|
{Name: "deepseek-v3.1", Alias: alias},
|
|
|
|
|
{Name: "glm-5", Alias: alias},
|
|
|
|
|
}, executor)
|
|
|
|
|
|
|
|
|
@@ -436,7 +436,7 @@ func TestManagerExecuteStream_OpenAICompatAliasPoolRetriesOnEmptyBootstrap(t *te
|
|
|
|
|
t.Fatalf("payload = %q, want %q", string(payload), "glm-5")
|
|
|
|
|
}
|
|
|
|
|
got := executor.StreamModels()
|
|
|
|
|
want := []string{"qwen3.5-plus", "glm-5"}
|
|
|
|
|
want := []string{"deepseek-v3.1", "glm-5"}
|
|
|
|
|
for i := range want {
|
|
|
|
|
if got[i] != want[i] {
|
|
|
|
|
t.Fatalf("stream call %d model = %q, want %q", i, got[i], want[i])
|
|
|
|
@@ -448,10 +448,10 @@ func TestManagerExecuteStream_OpenAICompatAliasPoolFallsBackBeforeFirstByte(t *t
|
|
|
|
|
alias := "claude-opus-4.66"
|
|
|
|
|
executor := &openAICompatPoolExecutor{
|
|
|
|
|
id: "pool",
|
|
|
|
|
streamFirstErrors: map[string]error{"qwen3.5-plus": &Error{HTTPStatus: http.StatusTooManyRequests, Message: "quota"}},
|
|
|
|
|
streamFirstErrors: map[string]error{"deepseek-v3.1": &Error{HTTPStatus: http.StatusTooManyRequests, Message: "quota"}},
|
|
|
|
|
}
|
|
|
|
|
m := newOpenAICompatPoolTestManager(t, alias, []internalconfig.OpenAICompatibilityModel{
|
|
|
|
|
{Name: "qwen3.5-plus", Alias: alias},
|
|
|
|
|
{Name: "deepseek-v3.1", Alias: alias},
|
|
|
|
|
{Name: "glm-5", Alias: alias},
|
|
|
|
|
}, executor)
|
|
|
|
|
|
|
|
|
@@ -470,7 +470,7 @@ func TestManagerExecuteStream_OpenAICompatAliasPoolFallsBackBeforeFirstByte(t *t
|
|
|
|
|
t.Fatalf("payload = %q, want %q", string(payload), "glm-5")
|
|
|
|
|
}
|
|
|
|
|
got := executor.StreamModels()
|
|
|
|
|
want := []string{"qwen3.5-plus", "glm-5"}
|
|
|
|
|
want := []string{"deepseek-v3.1", "glm-5"}
|
|
|
|
|
for i := range want {
|
|
|
|
|
if got[i] != want[i] {
|
|
|
|
|
t.Fatalf("stream call %d model = %q, want %q", i, got[i], want[i])
|
|
|
|
@@ -486,10 +486,10 @@ func TestManagerExecuteStream_OpenAICompatAliasPoolStopsOnInvalidRequest(t *test
|
|
|
|
|
invalidErr := &Error{HTTPStatus: http.StatusUnprocessableEntity, Message: "unprocessable entity"}
|
|
|
|
|
executor := &openAICompatPoolExecutor{
|
|
|
|
|
id: "pool",
|
|
|
|
|
streamFirstErrors: map[string]error{"qwen3.5-plus": invalidErr},
|
|
|
|
|
streamFirstErrors: map[string]error{"deepseek-v3.1": invalidErr},
|
|
|
|
|
}
|
|
|
|
|
m := newOpenAICompatPoolTestManager(t, alias, []internalconfig.OpenAICompatibilityModel{
|
|
|
|
|
{Name: "qwen3.5-plus", Alias: alias},
|
|
|
|
|
{Name: "deepseek-v3.1", Alias: alias},
|
|
|
|
|
{Name: "glm-5", Alias: alias},
|
|
|
|
|
}, executor)
|
|
|
|
|
|
|
|
|
@@ -498,7 +498,7 @@ func TestManagerExecuteStream_OpenAICompatAliasPoolStopsOnInvalidRequest(t *test
|
|
|
|
|
t.Fatalf("execute stream error = %v, want %v", err, invalidErr)
|
|
|
|
|
}
|
|
|
|
|
got := executor.StreamModels()
|
|
|
|
|
if len(got) != 1 || got[0] != "qwen3.5-plus" {
|
|
|
|
|
if len(got) != 1 || got[0] != "deepseek-v3.1" {
|
|
|
|
|
t.Fatalf("stream calls = %v, want only first invalid model", got)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@@ -511,10 +511,10 @@ func TestManagerExecute_OpenAICompatAliasPoolSkipsSuspendedUpstreamOnLaterReques
|
|
|
|
|
}
|
|
|
|
|
executor := &openAICompatPoolExecutor{
|
|
|
|
|
id: "pool",
|
|
|
|
|
executeErrors: map[string]error{"qwen3.5-plus": modelSupportErr},
|
|
|
|
|
executeErrors: map[string]error{"deepseek-v3.1": modelSupportErr},
|
|
|
|
|
}
|
|
|
|
|
m := newOpenAICompatPoolTestManager(t, alias, []internalconfig.OpenAICompatibilityModel{
|
|
|
|
|
{Name: "qwen3.5-plus", Alias: alias},
|
|
|
|
|
{Name: "deepseek-v3.1", Alias: alias},
|
|
|
|
|
{Name: "glm-5", Alias: alias},
|
|
|
|
|
}, executor)
|
|
|
|
|
|
|
|
|
@@ -529,7 +529,7 @@ func TestManagerExecute_OpenAICompatAliasPoolSkipsSuspendedUpstreamOnLaterReques
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
got := executor.ExecuteModels()
|
|
|
|
|
want := []string{"qwen3.5-plus", "glm-5", "glm-5", "glm-5"}
|
|
|
|
|
want := []string{"deepseek-v3.1", "glm-5", "glm-5", "glm-5"}
|
|
|
|
|
if len(got) != len(want) {
|
|
|
|
|
t.Fatalf("execute calls = %v, want %v", got, want)
|
|
|
|
|
}
|
|
|
|
@@ -548,10 +548,10 @@ func TestManagerExecuteStream_OpenAICompatAliasPoolSkipsSuspendedUpstreamOnLater
|
|
|
|
|
}
|
|
|
|
|
executor := &openAICompatPoolExecutor{
|
|
|
|
|
id: "pool",
|
|
|
|
|
streamFirstErrors: map[string]error{"qwen3.5-plus": modelSupportErr},
|
|
|
|
|
streamFirstErrors: map[string]error{"deepseek-v3.1": modelSupportErr},
|
|
|
|
|
}
|
|
|
|
|
m := newOpenAICompatPoolTestManager(t, alias, []internalconfig.OpenAICompatibilityModel{
|
|
|
|
|
{Name: "qwen3.5-plus", Alias: alias},
|
|
|
|
|
{Name: "deepseek-v3.1", Alias: alias},
|
|
|
|
|
{Name: "glm-5", Alias: alias},
|
|
|
|
|
}, executor)
|
|
|
|
|
|
|
|
|
@@ -569,7 +569,7 @@ func TestManagerExecuteStream_OpenAICompatAliasPoolSkipsSuspendedUpstreamOnLater
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
got := executor.StreamModels()
|
|
|
|
|
want := []string{"qwen3.5-plus", "glm-5", "glm-5", "glm-5"}
|
|
|
|
|
want := []string{"deepseek-v3.1", "glm-5", "glm-5", "glm-5"}
|
|
|
|
|
if len(got) != len(want) {
|
|
|
|
|
t.Fatalf("stream calls = %v, want %v", got, want)
|
|
|
|
|
}
|
|
|
|
@@ -584,7 +584,7 @@ func TestManagerExecuteCount_OpenAICompatAliasPoolRotatesWithinAuth(t *testing.T
|
|
|
|
|
alias := "claude-opus-4.66"
|
|
|
|
|
executor := &openAICompatPoolExecutor{id: "pool"}
|
|
|
|
|
m := newOpenAICompatPoolTestManager(t, alias, []internalconfig.OpenAICompatibilityModel{
|
|
|
|
|
{Name: "qwen3.5-plus", Alias: alias},
|
|
|
|
|
{Name: "deepseek-v3.1", Alias: alias},
|
|
|
|
|
{Name: "glm-5", Alias: alias},
|
|
|
|
|
}, executor)
|
|
|
|
|
|
|
|
|
@@ -599,7 +599,7 @@ func TestManagerExecuteCount_OpenAICompatAliasPoolRotatesWithinAuth(t *testing.T
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
got := executor.CountModels()
|
|
|
|
|
want := []string{"qwen3.5-plus", "glm-5"}
|
|
|
|
|
want := []string{"deepseek-v3.1", "glm-5"}
|
|
|
|
|
for i := range want {
|
|
|
|
|
if got[i] != want[i] {
|
|
|
|
|
t.Fatalf("count call %d model = %q, want %q", i, got[i], want[i])
|
|
|
|
@@ -615,10 +615,10 @@ func TestManagerExecuteCount_OpenAICompatAliasPoolSkipsSuspendedUpstreamOnLaterR
|
|
|
|
|
}
|
|
|
|
|
executor := &openAICompatPoolExecutor{
|
|
|
|
|
id: "pool",
|
|
|
|
|
countErrors: map[string]error{"qwen3.5-plus": modelSupportErr},
|
|
|
|
|
countErrors: map[string]error{"deepseek-v3.1": modelSupportErr},
|
|
|
|
|
}
|
|
|
|
|
m := newOpenAICompatPoolTestManager(t, alias, []internalconfig.OpenAICompatibilityModel{
|
|
|
|
|
{Name: "qwen3.5-plus", Alias: alias},
|
|
|
|
|
{Name: "deepseek-v3.1", Alias: alias},
|
|
|
|
|
{Name: "glm-5", Alias: alias},
|
|
|
|
|
}, executor)
|
|
|
|
|
|
|
|
|
@@ -633,7 +633,7 @@ func TestManagerExecuteCount_OpenAICompatAliasPoolSkipsSuspendedUpstreamOnLaterR
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
got := executor.CountModels()
|
|
|
|
|
want := []string{"qwen3.5-plus", "glm-5", "glm-5", "glm-5"}
|
|
|
|
|
want := []string{"deepseek-v3.1", "glm-5", "glm-5", "glm-5"}
|
|
|
|
|
if len(got) != len(want) {
|
|
|
|
|
t.Fatalf("count calls = %v, want %v", got, want)
|
|
|
|
|
}
|
|
|
|
@@ -650,7 +650,7 @@ func TestManagerExecute_OpenAICompatAliasPoolBlockedAuthDoesNotConsumeRetryBudge
|
|
|
|
|
OpenAICompatibility: []internalconfig.OpenAICompatibility{{
|
|
|
|
|
Name: "pool",
|
|
|
|
|
Models: []internalconfig.OpenAICompatibilityModel{
|
|
|
|
|
{Name: "qwen3.5-plus", Alias: alias},
|
|
|
|
|
{Name: "deepseek-v3.1", Alias: alias},
|
|
|
|
|
{Name: "glm-5", Alias: alias},
|
|
|
|
|
},
|
|
|
|
|
}},
|
|
|
|
@@ -701,7 +701,7 @@ func TestManagerExecute_OpenAICompatAliasPoolBlockedAuthDoesNotConsumeRetryBudge
|
|
|
|
|
HTTPStatus: http.StatusBadRequest,
|
|
|
|
|
Message: "invalid_request_error: The requested model is not supported.",
|
|
|
|
|
}
|
|
|
|
|
for _, upstreamModel := range []string{"qwen3.5-plus", "glm-5"} {
|
|
|
|
|
for _, upstreamModel := range []string{"deepseek-v3.1", "glm-5"} {
|
|
|
|
|
m.MarkResult(context.Background(), Result{
|
|
|
|
|
AuthID: badAuth.ID,
|
|
|
|
|
Provider: "pool",
|
|
|
|
@@ -733,10 +733,10 @@ func TestManagerExecuteStream_OpenAICompatAliasPoolStopsOnInvalidBootstrap(t *te
|
|
|
|
|
invalidErr := &Error{HTTPStatus: http.StatusBadRequest, Message: "invalid_request_error: malformed payload"}
|
|
|
|
|
executor := &openAICompatPoolExecutor{
|
|
|
|
|
id: "pool",
|
|
|
|
|
streamFirstErrors: map[string]error{"qwen3.5-plus": invalidErr},
|
|
|
|
|
streamFirstErrors: map[string]error{"deepseek-v3.1": invalidErr},
|
|
|
|
|
}
|
|
|
|
|
m := newOpenAICompatPoolTestManager(t, alias, []internalconfig.OpenAICompatibilityModel{
|
|
|
|
|
{Name: "qwen3.5-plus", Alias: alias},
|
|
|
|
|
{Name: "deepseek-v3.1", Alias: alias},
|
|
|
|
|
{Name: "glm-5", Alias: alias},
|
|
|
|
|
}, executor)
|
|
|
|
|
|
|
|
|
@@ -750,7 +750,7 @@ func TestManagerExecuteStream_OpenAICompatAliasPoolStopsOnInvalidBootstrap(t *te
|
|
|
|
|
if streamResult != nil {
|
|
|
|
|
t.Fatalf("streamResult = %#v, want nil on invalid bootstrap", streamResult)
|
|
|
|
|
}
|
|
|
|
|
if got := executor.StreamModels(); len(got) != 1 || got[0] != "qwen3.5-plus" {
|
|
|
|
|
if got := executor.StreamModels(); len(got) != 1 || got[0] != "deepseek-v3.1" {
|
|
|
|
|
t.Fatalf("stream calls = %v, want only first upstream model", got)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|