feat: sync deployed v1.0.0-rc.38-custom.42

Sync production source including routing, billing, Astra detection and public uptime. Update custom build instructions and license packaging.
This commit is contained in:
cneicy committed 2026-09-26 04:49:11 +08:00
1 parent aa6c3f50f4
commit ceddfd3d6b
828 files changed
+122253 -13702

No files matched your search

+22
View File
@@ -70,3 +70,25 @@ func TestMaxTokensBounds(t *testing.T) {
require.Contains(t, err.Error(), "max_output_tokens is invalid")
})
}
func TestSGLangMinTokensBounds(t *testing.T) {
for _, tc := range []struct {
value string
valid bool
}{
{"0", true}, {"8192", true}, {"-1", false}, {"18446744073686646784", false},
} {
t.Run(tc.value, func(t *testing.T) {
c, _ := gin.CreateTestContext(httptest.NewRecorder())
c.Request = httptest.NewRequest(http.MethodPost, "/v1/chat/completions", bytes.NewBufferString(`{"model":"served-model","messages":[{"role":"user","content":"hi"}],"min_tokens":`+tc.value+`}`))
c.Request.Header.Set("Content-Type", "application/json")
request, err := GetAndValidateTextRequest(c, relayconstant.RelayModeChatCompletions)
if !tc.valid {
require.Error(t, err)
return
}
require.NoError(t, err)
require.NotNil(t, request.MinTokens)
})
}
}