mirror of
https://github.com/tiennm99/ccs.git
synced 2026-10-12 20:15:40 +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
|
// 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