fix(proxy): share the parallel-request slot with the SSE keepalive task

This commit is contained in:
goran-revops 2026-09-24 13:23:17 +02:00
parent 8bbe7edb71
commit be3193a298

View file

@ -1218,6 +1218,13 @@ async def open_sse_before_first_byte(
if interval is None:
return await produce_response
# The slot record must exist before this task is forked, or the release
# looks in the original task and never sees it.
from litellm.proxy.hooks.parallel_request_limiter_v3 import (
get_or_create_request_stash,
)
get_or_create_request_stash()
produce_task: Final = asyncio.ensure_future(produce_response)
await asyncio.wait((produce_task,), timeout=interval)
if produce_task.done():