Commit Graph

1 Commits

Author SHA1 Message Date
Dallin Romney
940f940f79
feat(embed): retry transient embedding errors (#6)
* feat(embed): retry transient embedding errors and survive partial failures

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.

* fix(embed): avoid final retry sleep

---------

Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
2026-04-30 23:35:21 -07:00