Recognize Claude weekly limits #16

Merged
temeddix merged 1 commits from fix-weekly-limit-fallback into main 2026-09-23 20:27:48 +00:00
2 changed files with 2 additions and 2 deletions
Showing only changes of commit 489c018dcd - Show all commits
+1 -1
View File
@@ -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));
}
+1 -1
View File
@@ -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");
},