feat(embed): retry transient embedding errors#6
Merged
vincentkoc merged 2 commits intoopenclaw:mainfrom May 1, 2026
Merged
Conversation
c0cfcb1 to
1b34263
Compare
…lures Classify OpenAI embedding errors into a typed APIError and retry transient ones (429, 5xx, network timeouts) with Retry-After-aware exponential backoff and jitter; longer base for overloaded_error. insufficient_quota, 4xx, and ctx errors surface immediately. Replace abort-on-first-error with a per-batch retry queue: each batch retries once with fresh backoff and the rest keep going. Final run status is success / partial / error / cancelled, and stats_json carries retries plus per-batch failure metadata for diagnostics.
1b34263 to
be2251a
Compare
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
APIError(status / type / code / Retry-After).overloaded_error.insufficient_quota, 4xx, and ctx errors surface immediately.success/partial/error/cancelled, with retries and per-batch failure metadata persisted tostats_json.Test plan
go test ./...insufficient_quotano-retry,overloaded_errorbackoff, ctx cancellation, partial-success runs, cancelled runs.