Repository navigation
fix(inference): handle terminal failure statuses and bound polling in WaveSpeed provider - #5422
Open
viliamgonda wants to merge 2 commits into
Conversation
… WaveSpeed provider
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5422 +/- ##
==========================================
+ Coverage 75.00% 77.90% +2.90%
==========================================
Files 145 178 +33
Lines 13978 25523 +11545
==========================================
+ Hits 10484 19884 +9400
- Misses 3494 5639 +2145 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
This branch has not been deployed
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.
WaveSpeed documents
failed,cancelled,timeout, anddeletedas terminal task statuses. Previously, onlyfailedwas handled as a failure condition, whilecancelled,timeout, anddeletedraisedValueError: Unknown status: <status>. Whenfailedreturned with an empty error message, the exception message was left with a trailing colon (WaveSpeed AI task failed:). Furthermore, the polling loop ran indefinitely (while True) if a task remained inprocessingorcreated.failed,cancelled,timeout, anddeletedas terminal failures and format error messages cleanly with an optional error suffix._MAX_POLL_ATTEMPTS(7200 attempts at 0.5s interval, ~1 hour) before timing out.tests/test_inference_providers.py.Closes #5421
Note
Low Risk
Localized WaveSpeed provider error-handling and polling limits with new unit tests; behavior change is failing fast instead of hanging or mis-reporting status.
Overview
The WaveSpeed inference provider now treats
failed,cancelled,timeout, anddeletedas terminal outcomes instead of raising “unknown status” for the latter three. FailureValueErrormessages include the status name and only append: {error}when the API returns a non-empty error (fixing the stray trailing colon on empty errors).Result polling is no longer unbounded: a
_MAX_POLL_ATTEMPTScap (~1 hour at 0.5s) replaceswhile True, with an explicit timeoutValueErrorwhen the job stays inprocessing/created.Tests cover terminal failure messages (with/without error text), the happy path, and polling timeout.
Reviewed by Cursor Bugbot for commit bfbf684. Bugbot is set up for automated code reviews on this repo. Configure here.