From d0ad9d0534e279f087782e24d54811372977630e Mon Sep 17 00:00:00 2001 From: jiangnan <1394485448@qq.com> Date: Fri, 6 Mar 2026 04:08:21 +0800 Subject: [PATCH] test: use regex-only test string for service-unavailable overload --- .../pi-embedded-helpers.isbillingerrormessage.test.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/agents/pi-embedded-helpers.isbillingerrormessage.test.ts b/src/agents/pi-embedded-helpers.isbillingerrormessage.test.ts index 5651728deb3..b3c874b855b 100644 --- a/src/agents/pi-embedded-helpers.isbillingerrormessage.test.ts +++ b/src/agents/pi-embedded-helpers.isbillingerrormessage.test.ts @@ -540,10 +540,9 @@ describe("classifyFailoverReason", () => { "This model is currently experiencing high demand. Please try again later.", ), ).toBe("rate_limit"); - // "service unavailable" combined with overload indicator → rate_limit - expect( - classifyFailoverReason("service unavailable due to high demand and overloaded servers"), - ).toBe("rate_limit"); + // "service unavailable" combined with overload/capacity indicator → rate_limit + // (exercises the new regex — none of the standalone patterns match here) + expect(classifyFailoverReason("service unavailable due to capacity limits")).toBe("rate_limit"); expect( classifyFailoverReason( '{"error":{"code":503,"message":"The model is overloaded. Please try later","status":"UNAVAILABLE"}}',