diff --git a/src/profiles.ts b/src/profiles.ts index ec59181..b164c12 100644 --- a/src/profiles.ts +++ b/src/profiles.ts @@ -5,7 +5,7 @@ export type BotProfile = { }; function isUsageExhausted(error: unknown): boolean { - return /(?:usage|rate) limit|hit your limit|insufficient_quota|exceeded your current quota|too many requests|(?:api error|http error|http|status(?: code)?)[ :]+4(?:02|29)\b/i + return /(?:usage|rate) limit|hit your (?:weekly )?limit|insufficient_quota|exceeded your current quota|too many requests|(?:api error|http error|http|status(?: code)?)[ :]+4(?:02|29)\b/i .test(String(error)); } diff --git a/src/profiles_test.ts b/src/profiles_test.ts index 245b97c..25cecbd 100644 --- a/src/profiles_test.ts +++ b/src/profiles_test.ts @@ -33,7 +33,7 @@ Deno.test("recognizes Claude's weekly limit message", async () => { ], (profile) => { if (profile.type === "claude") { - throw new Error("You've hit your limit · resets Monday"); + throw new Error("You've hit your weekly limit · resets 12am (UTC)"); } return Promise.resolve("fallback"); },