fix(image-gen): preserve xAI API error status#15971
Closed
camaragon wants to merge 1 commit into
Closed
Conversation
f56ed2c to
40930a0
Compare
01c3e35 to
56ded12
Compare
61aff13 to
8172e34
Compare
6bed3cb to
c3f510b
Compare
1328bb3 to
c6dcd81
Compare
c6dcd81 to
d08f472
Compare
Contributor
|
Salvaged via #19697 onto current main - your commit authorship was preserved. Thanks! |
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.
Why change
xAI image generation errors can report HTTP status 0 even when xAI returns a real 4xx/5xx response.
requests.Responseobjects are falsy for error status codes, so the HTTPError handler treated real error responses as missing.Files changed
plugins/image_gen/xai/__init__.py: checkHTTPError.response is not Nonebefore reading status/message.tests/plugins/image_gen/test_xai_provider.py: add regression coverage with a realrequests.Responsestatus 401.Verification run
/home/caragon/.hermes/hermes-agent/venv/bin/python -m pytest tests/plugins/image_gen/test_xai_provider.py -q→ 19 passedRisk level
Low. Error-handling only; success path unchanged.