fix(proxy): keep the direct deferred-logging attribute write

The Any-reduction pass routed the deferred-logging teardown through a new
Logging.clear_deferred_logging_enqueue() helper. Callers in the request path
hand this function a MagicMock in tests, which absorbs the method call and
leaves _enqueue_deferred_logging set, so three deferred-guardrail-logging
assertions failed. Restore the direct attribute write and drop the helper.
This commit is contained in:
mateo-berri 2026-08-27 11:05:11 +00:00
parent 663aaa02a4
commit 5226401644
2 changed files with 1 additions and 4 deletions

View file

@ -563,9 +563,6 @@ class Logging(LiteLLMLoggingBaseClass):
self._defer_async_logging: bool = False
self._enqueue_deferred_logging: Callable[[], None] | None = None
def clear_deferred_logging_enqueue(self) -> None:
self._enqueue_deferred_logging = None
def process_dynamic_callbacks(self):
"""
Initializes CustomLogger compatible callbacks in self.dynamic_* callbacks

View file

@ -3046,7 +3046,7 @@ class ProxyBaseLLMRequestProcessing:
_enqueue_fn: Final = getattr(logging_obj, "_enqueue_deferred_logging", None)
if _enqueue_fn is None:
return
logging_obj.clear_deferred_logging_enqueue()
logging_obj._enqueue_deferred_logging = None
if exception_raised:
return
try: