@@ -276,7 +276,10 @@ func (h *OpenAIGatewayHandler) Responses(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
imageIntent := service.IsImageGenerationIntentForPlatform("/v1/responses", reqModel, body, openAICompatibleRequestPlatform(apiKey))
|
||||
// 使用 IsExplicitImageGenerationIntent 排除被动 image_gen namespace 声明。
|
||||
// Codex 在所有请求中被动声明 image_gen namespace,宽泛检测会导致禁了生图的
|
||||
// 分组中所有 Codex 请求被 403(#4447),并误占生图并发槽位。
|
||||
imageIntent := service.IsExplicitImageGenerationIntent("/v1/responses", reqModel, body)
|
||||
if imageIntent && !service.GroupAllowsImageGeneration(apiKey.Group) {
|
||||
h.errorResponse(c, http.StatusForbidden, "permission_error", service.ImageGenerationPermissionMessage())
|
||||
return
|
||||
@@ -1481,7 +1484,7 @@ func (h *OpenAIGatewayHandler) ResponsesWebSocket(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
imageIntent := service.IsImageGenerationIntentForPlatform("/v1/responses", reqModel, firstMessage, openAICompatibleRequestPlatform(apiKey))
|
||||
imageIntent := service.IsExplicitImageGenerationIntent("/v1/responses", reqModel, firstMessage)
|
||||
if imageIntent && !service.GroupAllowsImageGeneration(apiKey.Group) {
|
||||
closeOpenAIClientWS(wsConn, coderws.StatusPolicyViolation, service.ImageGenerationPermissionMessage())
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user