fix(openai): drop stream for responses/compact

This commit is contained in:
Shady Khalifa
2026-01-27 18:27:34 +02:00
parent 95096bc3fc
commit 53920b0399
3 changed files with 12 additions and 1 deletions

View File

@@ -18,6 +18,7 @@ import (
"github.com/router-for-me/CLIProxyAPI/v6/internal/registry"
"github.com/router-for-me/CLIProxyAPI/v6/sdk/api/handlers"
"github.com/tidwall/gjson"
"github.com/tidwall/sjson"
)
// OpenAIResponsesAPIHandler contains the handlers for OpenAIResponses API endpoints.
@@ -113,6 +114,11 @@ func (h *OpenAIResponsesAPIHandler) Compact(c *gin.Context) {
})
return
}
if streamResult.Exists() {
if updated, err := sjson.DeleteBytes(rawJSON, "stream"); err == nil {
rawJSON = updated
}
}
c.Header("Content-Type", "application/json")
modelName := gjson.GetBytes(rawJSON, "model").String()