feat(ai): add failover rule helpers#1484
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1484 +/- ##
==========================================
- Coverage 69.40% 69.28% -0.13%
==========================================
Files 377 377
Lines 30190 29613 -577
==========================================
- Hits 20954 20517 -437
+ Misses 8256 8151 -105
+ Partials 980 945 -35 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
hwbrzzl
reviewed
Jun 10, 2026
Comment on lines
+932
to
+935
| tests := []struct { | ||
| name string | ||
| run func(t *testing.T) | ||
| }{ |
Contributor
There was a problem hiding this comment.
Use t.Run style for these cases.
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
Why
The framework should stay provider-agnostic: it should react to
FailoverError, while provider packages decide how their own errors map to failover reasons. The new helper API lets external providers compile and apply user-provided failover rules without moving provider-specific matching into the framework runtime.This keeps OpenAI-specific behavior in
goravel/openaiwhile the framework owns only the shared contract and helper functions. Providers can call the helpers when they build or execute requests, then returnNewFailoverErrorthrough the normal failover path.