more flexible regex to detect session usage cooldown

This commit is contained in:
Simon Hünecke
2026-05-26 13:09:48 +02:00
committed by GitHub
parent a81d376322
commit 389a251ed1
+1 -1
View File
@@ -23,7 +23,7 @@ export function stripAnsi(text) {
// Detection: find a "limit" line and a "resets" line within 6 lines of each other.
const LIMIT_PATTERNS = [
/(?:hit|exceeded|reached).*(?:your|the)\s*(?:\d+-hour\s+)?limit/i, // "hit/exceeded/reached your limit"
/(?:hit|exceeded|reached).*?limit/i // matches: "hit ... limit" with anything in between
/\d+-hour limit/i, // "5-hour limit"
/limit reached/i, // "limit reached"
/usage limit/i, // "usage limit"