Raise on LiteLLM response.failed streams - #907
Open
ousamabenyounes wants to merge 1 commit into
Open
Conversation
Contributor
Greptile SummaryAdds a LiteLLM compatibility shim that converts streamed
Confidence Score: 5/5The PR appears safe to merge, with the failed-stream conversion covered through LiteLLM’s actual chunk-processing path. The compatibility patch is idempotent across repeated SDK configuration, tolerates supported event representations, and turns the previously silent failed event into the retry-classifiable exception intended by the change. Important Files Changed
Reviews (1): Last reviewed commit: "fix: raise litellm failed response strea..." | Re-trigger Greptile |
ousamabenyounes
force-pushed
the
fix/issue-719-litellm-response-failed
branch
from
July 27, 2026 20:36
d0d4495 to
0feea6b
Compare
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.
Fixes #719.
Summary
response.failed.APIError, so SDK retry policy can treat the failed stream as an actual model failure instead of normal completion.BaseResponsesAPIStreamingIterator._process_chunkpath with a regression test.Validation
uv run pytest tests/test_litellm_response_failed.py -q->Failed: DID NOT RAISE APIErroruv run pytest tests/test_litellm_response_failed.py -q->1 passedstrix/config/models.pypatch ->Failed: DID NOT RAISE APIErroruv run pytest tests/test_litellm_response_failed.py tests/test_model_retry.py tests/test_cost_tracking.py -q->17 passeduv run ruff check strix/config/models.py tests/test_litellm_response_failed.py-> passuv run ruff format --check strix/config/models.py tests/test_litellm_response_failed.py-> passuv run mypy strix/config/models.py tests/test_litellm_response_failed.py-> passuv run bandit -q -c pyproject.toml strix/config/models.py-> pass