Merge pull request #5654 from zninggo/fix/composite-video-generation

fix(gateway): Composite 分组放行视频生成端点
This commit is contained in:
Wesley Liddick
2026-08-21 21:27:17 +08:00
committed by GitHub
2 changed files with 16 additions and 1 deletions
+4 -1
View File
@@ -95,7 +95,10 @@ func RegisterGatewayRoutes(
}
}
videoGenerationHandler := func(c *gin.Context) {
if getGroupPlatform(c) == service.PlatformGrok {
// Video status/content lookups below already allow Composite groups; keep
// task creation aligned so composite keys that route to Grok accounts can
// submit video generation jobs.
if platform := getGroupPlatform(c); platform == service.PlatformGrok || platform == service.PlatformComposite {
h.OpenAIGateway.GrokVideoGeneration(c)
return
}
@@ -345,6 +345,18 @@ func TestGatewayRoutesNonGrokVideosAreRejectedAtPlatformGate(t *testing.T) {
}
}
func TestGatewayRoutesCompositeVideoGenerationAllowed(t *testing.T) {
router := newGatewayRoutesTestRouter(service.PlatformComposite)
req := httptest.NewRequest(http.MethodPost, "/v1/videos/generations", strings.NewReader(`{"model":"grok-imagine-video-1.5","prompt":"waves"}`))
req.Header.Set("Content-Type", "application/json")
w := httptest.NewRecorder()
router.ServeHTTP(w, req)
require.NotEqual(t, http.StatusNotFound, w.Code)
require.NotContains(t, w.Body.String(), "not supported")
}
func TestGatewayRoutesCompositeOpenAIOnlyEndpointsRequireOpenAITarget(t *testing.T) {
router := newGatewayRoutesTestRouter(service.PlatformComposite)