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();
|
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", () => {
|
describe("isCloudCodeAssistFormatError", () => {
|
||||||
|
|||||||
@@ -343,6 +343,7 @@ const ERROR_PATTERNS = {
|
|||||||
"resource has been exhausted",
|
"resource has been exhausted",
|
||||||
"quota exceeded",
|
"quota exceeded",
|
||||||
"resource_exhausted",
|
"resource_exhausted",
|
||||||
|
"usage limit",
|
||||||
],
|
],
|
||||||
timeout: [
|
timeout: [
|
||||||
"timeout",
|
"timeout",
|
||||||
|
|||||||
Reference in New Issue
Block a user