diff --git a/src/agents/pi-embedded-helpers.isbillingerrormessage.test.ts b/src/agents/pi-embedded-helpers.isbillingerrormessage.test.ts index fc1ec760752..b2347e8d98d 100644 --- a/src/agents/pi-embedded-helpers.isbillingerrormessage.test.ts +++ b/src/agents/pi-embedded-helpers.isbillingerrormessage.test.ts @@ -1014,6 +1014,12 @@ describe("classifyFailoverReason", () => { "402 You've used up your points! Visit https://poe.com/api/keys to get more.", ), ).toBe("billing"); + // Third-party proxy 402 with non-standard wording (#45774) + expect( + classifyFailoverReason( + "402 No available asset for API access, please purchase a subscription", + ), + ).toBe("billing"); expect(classifyFailoverReason(INSUFFICIENT_QUOTA_PAYLOAD)).toBe("billing"); expect(classifyFailoverReason("deadline exceeded")).toBe("timeout"); expect(classifyFailoverReason("request ended without sending any chunks")).toBe("timeout"); diff --git a/src/agents/pi-embedded-helpers/failover-matches.ts b/src/agents/pi-embedded-helpers/failover-matches.ts index 14d7ede0b1c..efa5ff62166 100644 --- a/src/agents/pi-embedded-helpers/failover-matches.ts +++ b/src/agents/pi-embedded-helpers/failover-matches.ts @@ -217,6 +217,8 @@ export function isBillingErrorMessage(raw: string): boolean { value.includes("upgrade") || value.includes("credits") || value.includes("payment") || + value.includes("purchase") || + value.includes("subscription") || value.includes("plan") ); }