[Bug fix]: aiohttp fixes for transfer encoding error on aiohttp transport - #11561
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes transfer-encoding error handling in the aiohttp transport and adds comprehensive async tests for various exception scenarios.
- Removed a redundant
map_aiohttp_exceptionswrapper around chunk iteration inAiohttpResponseStream.__aiter__. - Added tests covering normal flow, transfer-encoding errors,
ClientPayloadErrorhandling, unknown exception mapping, and timeout mapping.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| tests/test_litellm/llms/custom_httpx/test_aiohttp_transport.py | Added async tests for AiohttpResponseStream behavior and exception mapping |
| litellm/llms/custom_httpx/aiohttp_transport.py | Removed incorrect use of map_aiohttp_exceptions in __aiter__ |
Comments suppressed due to low confidence (1)
tests/test_litellm/llms/custom_httpx/test_aiohttp_transport.py:1
- Test files are placed under 'tests/test_litellm/...', but the project uses 'tests/litellm/...'; move this file to the correct directory so pytest can discover it.
import os
| @pytest.mark.asyncio | ||
| async def test_transfer_encoding_error_no_httpx_read_error(): | ||
| """Test that TransferEncodingError doesn't get converted to httpx.ReadError""" | ||
| import logging |
There was a problem hiding this comment.
Remove unused import 'logging' since it's not used in this test.
Suggested change
| import logging |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
fzowl
pushed a commit
to fzowl/litellm
that referenced
this pull request
Jun 24, 2026
…port (BerriAI#11561) * fix: fixes for transfer encoding error on aiohttp transport * Update tests/test_litellm/llms/custom_httpx/test_aiohttp_transport.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
[Bug fix]: aiohttp fixes for transfer encoding error on aiohttp transport
This PR fixes transfer-encoding error handling in the aiohttp transport and adds comprehensive async tests for various exception scenarios.
Relevant issues
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
tests/litellm/directory, Adding at least 1 test is a hard requirement - see detailsmake test-unitType
🐛 Bug Fix
✅ Test
Changes