mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 21:48:27 +00:00
fix(agents): detect Kimi model-token-limit overflows
Co-authored-by: Danilo Falcão <danilo@falcao.org>
This commit is contained in:
@@ -178,6 +178,17 @@ describe("isContextOverflowError", () => {
|
||||
}
|
||||
});
|
||||
|
||||
it("matches Kimi 'model token limit' context overflow errors", () => {
|
||||
const samples = [
|
||||
"Invalid request: Your request exceeded model token limit: 262144 (requested: 291351)",
|
||||
"error, status code: 400, message: Invalid request: Your request exceeded model token limit: 262144 (requested: 291351)",
|
||||
"Your request exceeded model token limit",
|
||||
];
|
||||
for (const sample of samples) {
|
||||
expect(isContextOverflowError(sample)).toBe(true);
|
||||
}
|
||||
});
|
||||
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user