fix: add 'usage limit' to rate limit detection patterns
OpenAI/ChatGPT returns "You have hit your ChatGPT usage limit (plus plan)" when users exceed their plan quota. This error wasn't being recognized as a rate limit, so fallback to alternative models wasn't triggering. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
committed by
Peter Steinberger
parent
08cc8f2281
commit
0afa370869
@@ -272,6 +272,14 @@ describe("classifyFailoverReason", () => {
|
||||
);
|
||||
expect(classifyFailoverReason("bad request")).toBeNull();
|
||||
});
|
||||
|
||||
it("classifies OpenAI usage limit errors as rate_limit", () => {
|
||||
expect(
|
||||
classifyFailoverReason(
|
||||
"You have hit your ChatGPT usage limit (plus plan)",
|
||||
),
|
||||
).toBe("rate_limit");
|
||||
});
|
||||
});
|
||||
|
||||
describe("isCloudCodeAssistFormatError", () => {
|
||||
|
||||
@@ -343,6 +343,7 @@ const ERROR_PATTERNS = {
|
||||
"resource has been exhausted",
|
||||
"quota exceeded",
|
||||
"resource_exhausted",
|
||||
"usage limit",
|
||||
],
|
||||
timeout: [
|
||||
"timeout",
|
||||
|
||||
Reference in New Issue
Block a user