Recognize Claude weekly limits
Agents / agent (pull_request) Has been skipped
Check / deno (pull_request) Successful in 37s

This commit is contained in:
Danny Kim
2026-09-24 05:26:33 +09:00
parent 535a7a486c
commit 489c018dcd
2 changed files with 2 additions and 2 deletions
+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");
},