feat: lower default retry wait time and increase number of tries (#720)
In total we now guarantee that we will wait for at least 60s before giving up. --------- Signed-off-by: Thibault Sottiaux <tibo@openai.com>
This commit is contained in:
committed by
GitHub
parent
e79549f039
commit
d09dbba7ec
@@ -34,7 +34,7 @@ import OpenAI, { APIConnectionTimeoutError } from "openai";
|
||||
|
||||
// Wait time before retrying after rate limit errors (ms).
|
||||
const RATE_LIMIT_RETRY_WAIT_MS = parseInt(
|
||||
process.env["OPENAI_RATE_LIMIT_RETRY_WAIT_MS"] || "2500",
|
||||
process.env["OPENAI_RATE_LIMIT_RETRY_WAIT_MS"] || "500",
|
||||
10,
|
||||
);
|
||||
|
||||
@@ -671,7 +671,7 @@ export class AgentLoop {
|
||||
let stream;
|
||||
|
||||
// Retry loop for transient errors. Up to MAX_RETRIES attempts.
|
||||
const MAX_RETRIES = 5;
|
||||
const MAX_RETRIES = 8;
|
||||
for (let attempt = 1; attempt <= MAX_RETRIES; attempt++) {
|
||||
try {
|
||||
let reasoning: Reasoning | undefined;
|
||||
|
||||
Reference in New Issue
Block a user