fix(cursor): tighten rate limit detection string matching

Use specific patterns ('rate limit', 'resource_exhausted', 'too many
requests') instead of broad 'rate' or 'limit' substrings that would
false-positive on unrelated errors like 'character limit exceeded'.
This commit is contained in:
Tam Nhu Tran
2026-02-12 03:38:31 +07:00
parent c5e8241393
commit 79ba1de4e2
+4 -2
View File
@@ -438,9 +438,11 @@ export class CursorExecutor {
// Check for protobuf-decoded error
if (result.error) {
const errorLower = result.error.toLowerCase();
const isRateLimit =
result.error.toLowerCase().includes('rate') ||
result.error.toLowerCase().includes('limit');
errorLower.includes('rate limit') ||
errorLower.includes('resource_exhausted') ||
errorLower.includes('too many requests');
yield {
type: 'error',
response: new Response(