Skip to content

Fix unknown status handling in polling loops#113

Merged
Omar-V2 merged 1 commit intomainfrom
fix/unknown-status-polling-warning
Mar 18, 2026
Merged

Fix unknown status handling in polling loops#113
Omar-V2 merged 1 commit intomainfrom
fix/unknown-status-polling-warning

Conversation

@Omar-V2
Copy link
Collaborator

@Omar-V2 Omar-V2 commented Mar 18, 2026

Fix unknown status handling in polling loops

  • Replace ValueError with warnings.warn for unknown statuses in video and collections polling
  • Continue polling instead of crashing when encountering unrecognized statuses
  • Add tests for unknown status warning behavior in sync and async video clients
  • Update warning messages to be more descriptive

Improve TimeoutError messages with operation context

  • Add optional parameter to for descriptive timeout errors
  • Pass context strings from all polling callers (collections, video, chat)
  • Round timeout duration to 1 decimal place in error message
  • Update timeout test assertion to check for contextual message

- Replace ValueError with warnings.warn for unknown statuses in video and collections polling
- Continue polling instead of crashing when encountering unrecognized statuses
- Add tests for unknown status warning behavior in sync and async video clients
- Update warning messages to be more descriptive

* Improve TimeoutError messages with operation context

- Add optional  parameter to  for descriptive timeout errors
- Pass context strings from all polling callers (collections, video, chat)
- Round timeout duration to 1 decimal place in error message
- Update timeout test assertion to check for contextual message
@Omar-V2 Omar-V2 merged commit 3668037 into main Mar 18, 2026
7 checks passed
@Omar-V2 Omar-V2 deleted the fix/unknown-status-polling-warning branch March 18, 2026 01:58
double-di pushed a commit that referenced this pull request Mar 19, 2026
Prepare to release `v1.9.0` of the xAI Python SDK which includes
- Support for image and video generation in batch requests (#112)
- Support for using JSONL files in batch requests (#112)
- Bug fix that prevents crashing on unknown statuses for polling in long
running requests such as video generation and document indexing (#113)
- Use of model literals for video and image models for IDE autocomplete
(#114)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants