From 9829bd9d3e51b6365ecfce923454fb69f73881d9 Mon Sep 17 00:00:00 2001 From: Luis Pater Date: Sat, 8 Aug 2026 06:32:09 +0800 Subject: [PATCH] fix(cliproxy): stop non-streaming keep-alive after OpenAI handler execution Closes: #4782 --- sdk/api/handlers/openai/openai_handlers.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sdk/api/handlers/openai/openai_handlers.go b/sdk/api/handlers/openai/openai_handlers.go index cdb3c6c2..84b32d57 100644 --- a/sdk/api/handlers/openai/openai_handlers.go +++ b/sdk/api/handlers/openai/openai_handlers.go @@ -436,7 +436,9 @@ func (h *OpenAIAPIHandler) handleNonStreamingResponse(c *gin.Context, rawJSON [] modelName := gjson.GetBytes(rawJSON, "model").String() cliCtx, cliCancel := h.GetContextWithCancel(h, c, context.Background()) + stopKeepAlive := h.StartNonStreamingKeepAlive(c, cliCtx) resp, upstreamHeaders, errMsg := h.ExecuteWithAuthManager(cliCtx, h.HandlerType(), modelName, rawJSON, h.GetAlt(c)) + stopKeepAlive() if errMsg != nil { h.WriteErrorResponse(c, errMsg) cliCancel(errMsg.Error) -- 2.51.2