mirror of
https://github.com/moltbot/moltbot.git
synced 2026-03-09 15:35:17 +00:00
fix(auth): classify missing OAuth scopes as auth failures (#24761)
This commit is contained in:
@@ -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(
|
||||
|
||||
@@ -655,6 +655,9 @@ const ERROR_PATTERNS = {
|
||||
"unauthorized",
|
||||
"forbidden",
|
||||
"access denied",
|
||||
"insufficient permissions",
|
||||
"insufficient permission",
|
||||
/missing scopes?:/i,
|
||||
"expired",
|
||||
"token has expired",
|
||||
/\b401\b/,
|
||||
|
||||
Reference in New Issue
Block a user