fix(live): classify Z.ai plan denials as billing drift

This commit is contained in:
Peter Steinberger
2026-05-27 00:34:50 +01:00
parent 678a0ee944
commit 693f06d811
2 changed files with 8 additions and 0 deletions

View File

@@ -15,6 +15,12 @@ describe("Z.ai vendor error codes (#48988)", () => {
expect(isBillingErrorMessage(raw)).toBe(true);
});
it("classifies prose-only subscription plan access denials as billing", () => {
const raw =
"FailoverError: Your current subscription plan does not yet include access to GLM-5V-Turbo";
expect(isBillingErrorMessage(raw)).toBe(true);
});
it("classifies Z.ai 1311 with spaces as billing", () => {
const raw = '{"code": 1311, "message": "model not on plan"}';
expect(isBillingErrorMessage(raw)).toBe(true);

View File

@@ -204,6 +204,8 @@ const ERROR_PATTERNS = {
"账户已欠费",
// Z.ai: error 1311 = model not included in current subscription plan (#48988)
ZAI_BILLING_CODE_1311_RE,
/\bcurrent\s+subscription\s+plan\b.*\b(?:does\s+not|doesn't|not)\b.*\binclude\s+access\b/i,
/\bmodel\b.*\bnot\s+available\b.*\bcurrent\s+plan\b/i,
],
authPermanent: HIGH_CONFIDENCE_AUTH_PERMANENT_PATTERNS,
auth: [