@kenkaiiii/gg-agent 5.39.0 → 5.39.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +7 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +7 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -83,7 +83,13 @@ function isContextOverflow(err) {
|
|
|
83
83
|
if (overflowStatus === 402) return false;
|
|
84
84
|
if (isBillingError(err)) return false;
|
|
85
85
|
const msg = err.message.toLowerCase();
|
|
86
|
-
|
|
86
|
+
if (msg.includes("prompt is too long") || msg.includes("prompt too long") || msg.includes("input is too long") || msg.includes("context_length_exceeded") || msg.includes("context_window_exceeded") || msg.includes("maximum context length") || msg.includes("exceeds model context window") || msg.includes("exceeds the context window") || msg.includes("content_too_large") || msg.includes("request_too_large") || msg.includes("reduce the length") || msg.includes("please shorten")) {
|
|
87
|
+
return true;
|
|
88
|
+
}
|
|
89
|
+
const rateLimited = overflowStatus === 429 || msg.includes("rate limit") || msg.includes("rate_limit") || msg.includes("too many requests");
|
|
90
|
+
const perUnitTime = msg.includes("per min") || msg.includes("/min") || msg.includes("per minute") || msg.includes("per hour") || msg.includes("per day") || msg.includes("tpm") || msg.includes("rpm");
|
|
91
|
+
if (rateLimited && perUnitTime) return false;
|
|
92
|
+
return msg.includes("token") && msg.includes("exceed");
|
|
87
93
|
}
|
|
88
94
|
function parseOverflowNumber(value) {
|
|
89
95
|
return Number(value.replace(/[,_\s]/g, ""));
|