This commit is contained in:
2026-08-23 13:08:14 +02:00
parent ee1405cc1a
commit 89ae7e5fa8
4 changed files with 74 additions and 7 deletions
+3 -1
View File
@@ -507,7 +507,9 @@ func (c *OpenAIClient) doComplete(ctx context.Context, system, user string, temp
msg := formatOpenAIHTTPError(res.StatusCode, parsed.Error)
httpErr := errors.New(msg)
stopWait(httpErr)
return Completion{}, true, httpErr
// insufficient_quota also arrives as HTTP 429 — do not burn MaxRetries.
retryable := res.StatusCode >= 500 || openAIErrorIsRetryableRateLimit(parsed.Error)
return Completion{}, retryable, httpErr
}
if res.StatusCode >= 400 {
msg := formatOpenAIHTTPError(res.StatusCode, parsed.Error)