fix(xai-video): preserve timeout and transport error types - #57224
Open
EndeavorYen wants to merge 1 commit into
Open
fix(xai-video): preserve timeout and transport error types#57224EndeavorYen wants to merge 1 commit into
EndeavorYen wants to merge 1 commit into
Conversation
EndeavorYen
marked this pull request as ready for review
July 2, 2026 16:50
Contributor
|
Thanks for the focused fix. Current Automated hermes-sweeper review. |
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.
Summary
error_type="timeout"error_type="connection_error"api_errorhttpx.ReadTimeoutandhttpx.ConnectErrorProblem
The synchronous xAI video wrapper catches exceptions raised while running the async generation/edit/extend coroutine. Today those wrapper-level exceptions are collapsed into
api_error, so callers cannot distinguish a transient timeout or connection failure from a provider API response error.That loses useful recovery signal for retry/fallback guidance and makes diagnostics less precise when the provider path fails before a structured xAI response is available.
Fix
Add a small wrapper exception classifier:
TimeoutErrorandhttpx.TimeoutExceptionmap totimeouthttpx.TransportErrormaps toconnection_errorapi_errorThe user-facing error string now includes the exception class name, which makes empty-message timeout exceptions diagnosable without changing the response schema.
Duplicate / Related Work Audit
I checked current
mainand GitHub issues/PRs for the same fix. I did not find an existing issue or PR that preserves xAI video wrapper timeout/transport error types.Related but not duplicate:
Validation
pytest tests/plugins/video_gen-> 46 passedgit diff --check