feat(FN-1462): add context window exceeds limit pattern to context-limit-detector
- Add new regex pattern /context\s+window\s+exceeds/i to match provider JSON error envelope variant: "context window exceeds limit (2013)" - Add 4 new test cases for the variant pattern - Pattern is conservative: requires both "context window" and "exceeds" present
This commit is contained in:
@@ -39,6 +39,9 @@ const CONTEXT_OVERFLOW_PATTERNS: RegExp[] = [
|
||||
/too many tokens/i,
|
||||
// Anthropic variant: "messages with that many tokens would exceed"
|
||||
/tokens? would exceed/i,
|
||||
// Provider JSON error envelope variant: "context window exceeds limit (2013)"
|
||||
// Matches when "context window" and "exceeds" appear together (order-flexible)
|
||||
/context\s+window\s+exceeds/i,
|
||||
];
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user