diff --git a/astrbot/core/provider/sources/openai_source.py b/astrbot/core/provider/sources/openai_source.py index b8ee50203..64e3a6645 100644 --- a/astrbot/core/provider/sources/openai_source.py +++ b/astrbot/core/provider/sources/openai_source.py @@ -1076,7 +1076,7 @@ class ProviderOpenAIOfficial(Provider): image_fallback_used, ) raise e - if "maximum context length" in str(e): + if "maximum context length" in str(e) or "context length" in str(e).lower(): logger.warning( f"上下文长度超过限制。尝试弹出最早的记录然后重试。当前记录条数: {len(context_query)}", )