fix(ai): classify Novita context length rejections as context overflow (#52134)

This commit is contained in:
Aiden Cline
2026-09-30 22:40:07 -05:00
committed by GitHub
Unverified
parent 9c4c5870b6
commit f0f4c94c0a
2 changed files with 3 additions and 1 deletions
+2 -1
View File
@@ -30,7 +30,8 @@ const patterns = [
/requested input length \d+ exceeds maximum input length/i,
/maximum context length is \d+ tokens/i,
/exceeds (?:the )?maximum allowed input length of [\d,]+ tokens?/i,
/input \(\d+ tokens\) is longer than the model'?s context length \(\d+ tokens\)/i,
// Novita omits the token counts.
/input(?: \(\d+ tokens\))? is longer than the model'?s context length/i,
/exceeds the limit of \d+/i,
/exceeds the available context size/i,
/greater than the context length/i,
+1
View File
@@ -11,6 +11,7 @@ describe("provider error classification", () => {
"Input length (265330) exceeds model's maximum context length (262144).",
"Input length 131393 exceeds the maximum allowed input length of 131040 tokens.",
"The input (516368 tokens) is longer than the model's context length (262144 tokens).",
"The input is longer than the model's context length trace_id: 39d8c3a5c6c91dbc8dd9055f0b37e084",
"Prompt has 5,958,968 tokens, but the configured context size is 256,000 tokens",
"Range of input length should be [1, 129024]",
"Too many tokens",