diff --git a/scripts/ab-corpus/clients/ark.ts b/scripts/ab-corpus/clients/ark.ts index 4bb093cdb..0013b06ce 100644 --- a/scripts/ab-corpus/clients/ark.ts +++ b/scripts/ab-corpus/clients/ark.ts @@ -47,9 +47,11 @@ export async function callArk(args: CallArkArgs): Promise { // failure was Ark returning empty `choices[0].message.content` or // exceeding the 120s wall clock, not a model-quality issue (the // model itself routed to the right element tool 80% of the time - // when it did respond). One retry is the minimum that flips most - // of those into successes; bumping higher would mostly waste - // budget on the genuinely broken minority. - retries: 1, + // when it did respond). retries=1 left 36 empty + 15 timeout + 4 + // 429 still leaking through ab-v3 (520 calls); retries=2 with + // exponential backoff gives the provider a 1000ms recovery window + // before the third attempt, which on Ark's coding tier is usually + // enough to clear the upstream brownout. + retries: 2, }); } diff --git a/scripts/ab-corpus/clients/deepseek.ts b/scripts/ab-corpus/clients/deepseek.ts index 1997be4b6..a05e02be4 100644 --- a/scripts/ab-corpus/clients/deepseek.ts +++ b/scripts/ab-corpus/clients/deepseek.ts @@ -40,9 +40,9 @@ export async function callDeepSeek(args: CallDeepSeekArgs): Promise chatter that characterizes minimax model-side failures. + retries: 1, }); } diff --git a/scripts/ab-corpus/clients/openai-compat.ts b/scripts/ab-corpus/clients/openai-compat.ts index 64e461fd3..36ad9b2ac 100644 --- a/scripts/ab-corpus/clients/openai-compat.ts +++ b/scripts/ab-corpus/clients/openai-compat.ts @@ -70,16 +70,20 @@ export interface CallOpenAICompatArgs { */ timeoutMs?: number; /** - * Retry attempts on transient errors. Default 0 (no retry). Set to 1 + * Retry attempts on transient errors. Default 0 (no retry). Set to 2 * for providers known to flake on empty content / timeout (Ark hosting - * GLM-5.1+Kimi-K2.6, DeepSeek api.deepseek.com). MiniMax / Bailian / - * Codex don't enable this — their ab-v2 failures were model-quality - * (truncation, malformed DSL), where retry burns budget for nothing. + * GLM-5.1+Kimi-K2.6, DeepSeek api.deepseek.com). 1 is enough for + * MiniMax (saw 4 timeouts in 104 ab-v3 runs); Codex / Bailian don't + * enable this — their ab-v2 failures were model-quality (truncation, + * malformed DSL), where retry burns budget for nothing. * * Retried: empty `choices[0].message.content`, abort/timeout, HTTP 5xx, * HTTP 429. NOT retried: HTTP 4xx other than 429 (auth / bad request). * - * Backoff: linear, 250ms × (attempt+1). + * Backoff: exponential, 250ms × 4^attempt — 250ms before retry 1, + * 1000ms before retry 2, 4000ms before retry 3. Linear backoff was + * too tight when retries=2 (500ms then 750ms is < a typical Ark + * recovery window); exponential gives the provider room to settle. */ retries?: number; } @@ -105,13 +109,14 @@ export async function callOpenAICompat(args: CallOpenAICompatArgs): Promise