mirror of
https://github.com/tiennm99/ccs.git
synced 2026-07-17 04:17:11 +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:
@@ -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