refactor(router): drop redundant ttft deadline guard

asyncio.wait_for already raises TimeoutError for a non-positive timeout, so
the explicit remaining<=0 check duplicated wait_for's own behavior. Removing
it keeps the same observable result (litellm.Timeout via the except clause)
and lets wait_for return an already-ready chunk instead of spuriously timing
out.
This commit is contained in:
Nathan Price 2026-06-18 07:19:31 -05:00
parent adeb27dba6
commit 6f87b4e649

View file

@ -2917,8 +2917,6 @@ class Router:
chunk = await aiter.__anext__()
else:
remaining = deadline - loop.time()
if remaining <= 0:
raise asyncio.TimeoutError
chunk = await asyncio.wait_for(
aiter.__anext__(), timeout=remaining
)