From 79ba1de4e237f126a65b981660755a0845925ce9 Mon Sep 17 00:00:00 2001 From: Tam Nhu Tran Date: Thu, 12 Feb 2026 03:38:31 +0700 Subject: [PATCH] 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'. --- src/cursor/cursor-executor.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/cursor/cursor-executor.ts b/src/cursor/cursor-executor.ts index cf231387..3a4093b4 100644 --- a/src/cursor/cursor-executor.ts +++ b/src/cursor/cursor-executor.ts @@ -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(