From 340061916e4ba463a99e81f8aa41ce660c4e8931 Mon Sep 17 00:00:00 2001 From: Aryan Deshmukh Date: Sat, 24 Oct 2026 12:38:55 +0530 Subject: [PATCH] fix(proxy): compare the stream buffer through a cast Binding the narrowed operand to Sequence[object] moved the error from reportUnknownArgumentType to reportUnknownVariableType. Cast it where it is compared, with the cast-ok marker the discipline gate asks for. --- litellm/proxy/pass_through_endpoints/bounded_chunk_buffer.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/litellm/proxy/pass_through_endpoints/bounded_chunk_buffer.py b/litellm/proxy/pass_through_endpoints/bounded_chunk_buffer.py index fc68f3de7a9..a68b14689fa 100644 --- a/litellm/proxy/pass_through_endpoints/bounded_chunk_buffer.py +++ b/litellm/proxy/pass_through_endpoints/bounded_chunk_buffer.py @@ -1,6 +1,6 @@ from collections import deque from collections.abc import Iterator, Sequence -from typing import Final, overload +from typing import Final, cast, overload _FRAME_SEPARATORS: Final = (b"\r\n\r\n", b"\n\n") @@ -110,8 +110,7 @@ class BoundedChunkBuffer(Sequence[bytes]): def __eq__(self, other: object) -> bool: if not isinstance(other, Sequence): return False - other_items: Final[Sequence[object]] = other - return list(self) == list(other_items) + return list(self) == list(cast(Sequence[object], other)) # cast-ok: isinstance narrows to Sequence[Unknown] def __bool__(self) -> bool: return self.total_bytes > 0