From 74f55b06715bf340775f1aec67bd27942bcf9478 Mon Sep 17 00:00:00 2001 From: user <70670632+stuxf@users.noreply.github.com> Date: Fri, 3 Apr 2026 23:16:40 +0000 Subject: [PATCH] fix: apply mask_sensitive_info to async streaming error body MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Addresses Greptile review — the async streaming path was missing mask_sensitive_info() on the response body, while the sync path had it. --- litellm/llms/custom_httpx/http_handler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/litellm/llms/custom_httpx/http_handler.py b/litellm/llms/custom_httpx/http_handler.py index fdb05d1a91b..859afcfe7e5 100644 --- a/litellm/llms/custom_httpx/http_handler.py +++ b/litellm/llms/custom_httpx/http_handler.py @@ -352,7 +352,7 @@ def _raise_masked_sync_error(e: httpx.HTTPStatusError, stream: bool) -> None: async def _raise_masked_async_error(e: httpx.HTTPStatusError, stream: bool) -> None: """Raise a MaskedHTTPStatusError for async HTTP handlers.""" if stream: - _body = await _safe_aread_response(e.response) + _body = mask_sensitive_info(await _safe_aread_response(e.response)) raise MaskedHTTPStatusError(e, message=_body, text=_body) from None _text = mask_sensitive_info(_safe_get_response_text(e.response)) raise MaskedHTTPStatusError(e, message=_text, text=_text) from None