fix(auth): classify missing OAuth scopes as auth failures (#24761)

This commit is contained in:
Peter Machona
2026-02-24 03:33:44 +00:00
committed by GitHub
parent 38da3f40cb
commit 9ced64054f
2 changed files with 7 additions and 0 deletions

View File

@@ -393,6 +393,10 @@ describe("classifyFailoverReason", () => {
expect(classifyFailoverReason("invalid api key")).toBe("auth");
expect(classifyFailoverReason("no credentials found")).toBe("auth");
expect(classifyFailoverReason("no api key found")).toBe("auth");
expect(classifyFailoverReason("You have insufficient permissions for this operation.")).toBe(
"auth",
);
expect(classifyFailoverReason("Missing scopes: model.request")).toBe("auth");
expect(classifyFailoverReason("429 too many requests")).toBe("rate_limit");
expect(classifyFailoverReason("resource has been exhausted")).toBe("rate_limit");
expect(

View File

@@ -655,6 +655,9 @@ const ERROR_PATTERNS = {
"unauthorized",
"forbidden",
"access denied",
"insufficient permissions",
"insufficient permission",
/missing scopes?:/i,
"expired",
"token has expired",
/\b401\b/,