From 6a3069514c1308b54d1d65eae4bec69b610804d7 Mon Sep 17 00:00:00 2001 From: zhonghongwei <16784673+zhonghongwei123@user.noreply.gitee.com> Date: Thu, 7 May 2026 10:26:51 +0800 Subject: [PATCH] fix(api): remove enable_compression to restore real SSE streaming The HTTP compression buffer in aiohttp held all SSE chunks until the stream ended, making streaming appear batched instead of incremental. SSE payloads are small and frequent, so compression provides negligible benefit while breaking real-time delivery. --- nanobot/api/server.py | 1 - 1 file changed, 1 deletion(-) diff --git a/nanobot/api/server.py b/nanobot/api/server.py index 0a79fa097..3262e39b2 100644 --- a/nanobot/api/server.py +++ b/nanobot/api/server.py @@ -239,7 +239,6 @@ async def handle_chat_completions(request: web.Request) -> web.Response: resp.content_type = "text/event-stream" resp.headers["Cache-Control"] = "no-cache" resp.headers["Connection"] = "keep-alive" - resp.enable_compression() await resp.prepare(request) chunk_id = f"chatcmpl-{uuid.uuid4().hex[:12]}"