mirror of
https://github.com/tiennm99/ccs.git
synced 2026-10-11 03:13:12 +00:00
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:
1 parent
c5e8241393
commit
79ba1de4e2
1 file changed
+4
-2
@@ -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(
|
||||
|
||||
Reference in new issue
Block a user