This commit is contained in:
Zhizhang Deng 2026-01-30 07:22:31 -03:00 committed by GitHub
commit f505d45ed1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -32,6 +32,8 @@ const CONTEXT_OVERFLOW_HINT_RE =
export function isLikelyContextOverflowError(errorMessage?: string): boolean { export function isLikelyContextOverflowError(errorMessage?: string): boolean {
if (!errorMessage) return false; if (!errorMessage) return false;
if (CONTEXT_WINDOW_TOO_SMALL_RE.test(errorMessage)) return false; if (CONTEXT_WINDOW_TOO_SMALL_RE.test(errorMessage)) return false;
// Rate limit errors should not be classified as context overflow
if (isRateLimitErrorMessage(errorMessage)) return false;
if (isContextOverflowError(errorMessage)) return true; if (isContextOverflowError(errorMessage)) return true;
return CONTEXT_OVERFLOW_HINT_RE.test(errorMessage); return CONTEXT_OVERFLOW_HINT_RE.test(errorMessage);
} }