From c3c7b5a4a072b0699438091c3fa6f89c4700591a Mon Sep 17 00:00:00 2001 From: "jinli.yl" Date: Tue, 20 Jan 2026 20:47:24 +0800 Subject: [PATCH] fix(llm): enhance rate limit error detection in base LLM implementation --- reme_ai/core/llm/base_llm.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/reme_ai/core/llm/base_llm.py b/reme_ai/core/llm/base_llm.py index a4a9d50a..8f743ce6 100644 --- a/reme_ai/core/llm/base_llm.py +++ b/reme_ai/core/llm/base_llm.py @@ -402,7 +402,11 @@ class BaseLLM(ABC): # Check if this is an inappropriate content error error_message = str(e.args[0]) if e.args else str(e) is_inappropriate_content = "inappropriate content" in error_message.lower() - is_rate_limit_error = "request rate increased too quickly" in error_message.lower() + is_rate_limit_error = ( + "request rate increased too quickly" in error_message.lower() or + "exceeded your current quota" in error_message.lower() or + "insufficient_quota" in error_message.lower() + ) if is_inappropriate_content: logger.error(f"chat with model={effective_model} detected inappropriate content error") @@ -475,7 +479,11 @@ class BaseLLM(ABC): # Check if this is an inappropriate content error error_message = str(e.args[0]) if e.args else str(e) is_inappropriate_content = "inappropriate content" in error_message.lower() - is_rate_limit_error = "request rate increased too quickly" in error_message.lower() + is_rate_limit_error = ( + "request rate increased too quickly" in error_message.lower() or + "exceeded your current quota" in error_message.lower() or + "insufficient_quota" in error_message.lower() + ) if is_inappropriate_content: logger.error(f"chat sync with model={effective_model} detected inappropriate content error")