mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 16:10:49 +00:00
fix(failover): widen raw 402 detection for third-party proxy messages
This commit is contained in:
@@ -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");
|
||||
|
||||
@@ -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")
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user