retry capacity-style upstream errors
This commit is contained in:
@@ -17,6 +17,7 @@ import {
|
||||
getGatewayBaseUrl,
|
||||
getGatewayStatePaths,
|
||||
normalizeIntArray,
|
||||
normalizePhraseArray,
|
||||
normalizeStringArray,
|
||||
parseOptions,
|
||||
readJsonFile,
|
||||
@@ -185,6 +186,14 @@ function buildProfileConfig({ profileName, profileEnv, existingGatewayConfig, pr
|
||||
profileEnv.CODEX_RETRY_GATEWAY_REASONING_EQUALS || existingGatewayConfig?.reasoning_equals,
|
||||
[516],
|
||||
),
|
||||
retryable_status_codes: normalizeIntArray(
|
||||
profileEnv.CODEX_RETRY_GATEWAY_RETRYABLE_STATUS_CODES || existingGatewayConfig?.retryable_status_codes,
|
||||
[429, 503],
|
||||
),
|
||||
retryable_error_messages: normalizePhraseArray(
|
||||
profileEnv.CODEX_RETRY_GATEWAY_RETRYABLE_ERROR_MESSAGES || existingGatewayConfig?.retryable_error_messages,
|
||||
["Selected model is at capacity. Please try a different model."],
|
||||
),
|
||||
non_stream_status_code: profileEnv.CODEX_RETRY_GATEWAY_NON_STREAM_STATUS_CODE
|
||||
? Number.parseInt(`${profileEnv.CODEX_RETRY_GATEWAY_NON_STREAM_STATUS_CODE}`, 10)
|
||||
: Number.parseInt(`${existingGatewayConfig?.non_stream_status_code || 502}`, 10),
|
||||
|
||||
Reference in New Issue
Block a user