From c886150d1bd16921c4743cf04c4159c8d6bb7b74 Mon Sep 17 00:00:00 2001 From: Yashvardhan Didwania Date: Thu, 1 Oct 2026 16:49:24 +0530 Subject: [PATCH] fix(service_logger): keep the observer check inside the basedpyright budget bool(litellm.service_callback) passed a partially-unknown list as an argument (+1 reportUnknownArgumentType, over the per-rule limit). A plain truthiness test is the same check without the new diagnostic. Co-Authored-By: Claude Opus 5.5 --- litellm/_service_logger.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/litellm/_service_logger.py b/litellm/_service_logger.py index 89c177b91a5..958b31a8c8c 100644 --- a/litellm/_service_logger.py +++ b/litellm/_service_logger.py @@ -141,7 +141,9 @@ class ServiceLogging(CustomLogger): database queries with ``SynchronousOnlyOperation``. So skip it when there is no service callback (or test counter) to receive the event. """ - return bool(litellm.service_callback) or self.mock_testing + if litellm.service_callback: + return True + return self.mock_testing @staticmethod def _dispatch_from_sync(hook: Callable[[], Coroutine[object, object, None]]) -> None: