mirror of
https://github.com/tiennm99/ccs.git
synced 2026-09-03 00:17:47 +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
|
// Check for protobuf-decoded error
|
||||||
if (result.error) {
|
if (result.error) {
|
||||||
|
const errorLower = result.error.toLowerCase();
|
||||||
const isRateLimit =
|
const isRateLimit =
|
||||||
result.error.toLowerCase().includes('rate') ||
|
errorLower.includes('rate limit') ||
|
||||||
result.error.toLowerCase().includes('limit');
|
errorLower.includes('resource_exhausted') ||
|
||||||
|
errorLower.includes('too many requests');
|
||||||
yield {
|
yield {
|
||||||
type: 'error',
|
type: 'error',
|
||||||
response: new Response(
|
response: new Response(
|
||||||
|
|||||||
Reference in New Issue
Block a user