Skip to content

feat(embed): retry transient embedding errors#6

Merged
vincentkoc merged 2 commits intoopenclaw:mainfrom
RomneyDa:retry-embedding-errors
May 1, 2026
Merged

feat(embed): retry transient embedding errors#6
vincentkoc merged 2 commits intoopenclaw:mainfrom
RomneyDa:retry-embedding-errors

Conversation

@RomneyDa
Copy link
Copy Markdown
Contributor

@RomneyDa RomneyDa commented May 1, 2026

Summary

  • Classify OpenAI embedding failures via a typed APIError (status / type / code / Retry-After).
  • Retry transient ones (429, 5xx, network timeouts) with Retry-After-aware exponential backoff + 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, with retries and per-batch failure metadata persisted to stats_json.

Test plan

  • go test ./...
  • Covers Retry-After (seconds + HTTP-date), insufficient_quota no-retry, overloaded_error backoff, ctx cancellation, partial-success runs, cancelled runs.

@RomneyDa RomneyDa changed the title feat(embed): retry transient embedding errors and survive partial failures feat(embed): retry transient embedding errors May 1, 2026
@RomneyDa RomneyDa force-pushed the retry-embedding-errors branch from c0cfcb1 to 1b34263 Compare May 1, 2026 02:50
…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.
@RomneyDa RomneyDa force-pushed the retry-embedding-errors branch from 1b34263 to be2251a Compare May 1, 2026 02:56
@vincentkoc vincentkoc merged commit 940f940 into openclaw:main May 1, 2026
2 checks passed
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