AI service retry review
Use approved redacted error metadata; omit prompts, credentials and sensitive payloads.

Record provider/endpoint, SDK name and installed version, request ID, status/error type,
Retry-After, timeout, retry configuration, total deadline, and observed attempt count.
Check spend/quota/account errors separately from temporary rate/overload errors.
Choose the single layer responsible for retries. Count SDK attempts and outer attempts.
Confirm repeat safety for this operation; unknown outcome requires reconciliation.
Define additional retry count, elapsed deadline, cancellation, concurrency and queue limits.
Respect the provider wait hint or stop/defer; never shorten it just to fit a budget.
For production, implement random jitter, monotonic timing and per-attempt timeouts.
Handle stream interruptions and partial tool actions separately from HTTP status alone.
Show a clear pending/failed state and request ID; keep manual recovery available.
Test policy under controlled conditions before adopting it for real requests.
Do not infer security, cost savings or recovery guarantees from the offline exercise.
