Merge 74a46bde5d into 4583f88626
This commit is contained in:
commit
5b9285f170
@ -46,4 +46,12 @@ describe("isContextOverflowError", () => {
|
||||
expect(isContextOverflowError("model not found")).toBe(false);
|
||||
expect(isContextOverflowError("authentication failed")).toBe(false);
|
||||
});
|
||||
|
||||
it("ignores normal conversation text mentioning context overflow", () => {
|
||||
// These are legitimate conversation snippets, not error messages
|
||||
expect(isContextOverflowError("Let's investigate the context overflow bug")).toBe(false);
|
||||
expect(isContextOverflowError("The mystery context overflow errors are strange")).toBe(false);
|
||||
expect(isContextOverflowError("We're debugging context overflow issues")).toBe(false);
|
||||
expect(isContextOverflowError("Something is causing context overflow messages")).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
@ -20,7 +20,7 @@ export function isContextOverflowError(errorMessage?: string): boolean {
|
||||
lower.includes("prompt is too long") ||
|
||||
lower.includes("exceeds model context window") ||
|
||||
(hasRequestSizeExceeds && hasContextWindow) ||
|
||||
lower.includes("context overflow") ||
|
||||
lower.includes("context overflow:") ||
|
||||
(lower.includes("413") && lower.includes("too large"))
|
||||
);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user