mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 09:21:23 +00:00
fix(agents): exclude rate limit errors from context overflow classification (#13747)
Co-authored-by: 0xRaini <rain@0xRaini.dev>
This commit is contained in:
@@ -40,6 +40,12 @@ export function isLikelyContextOverflowError(errorMessage?: string): boolean {
|
||||
if (CONTEXT_WINDOW_TOO_SMALL_RE.test(errorMessage)) {
|
||||
return false;
|
||||
}
|
||||
// Rate limit errors can match the broad CONTEXT_OVERFLOW_HINT_RE pattern
|
||||
// (e.g., "request reached organization TPD rate limit" matches request.*limit).
|
||||
// Exclude them before checking context overflow heuristics.
|
||||
if (isRateLimitErrorMessage(errorMessage)) {
|
||||
return false;
|
||||
}
|
||||
if (isContextOverflowError(errorMessage)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user