fix(ai): detect z.ai context overflow

closes #1937
This commit is contained in:
Mario Zechner
2026-03-08 00:18:16 +01:00
parent d48843ea55
commit ade6a35e75
3 changed files with 16 additions and 8 deletions

View File

@@ -38,6 +38,7 @@ const OVERFLOW_PATTERNS = [
/context window exceeds limit/i, // MiniMax
/exceeded model token limit/i, // Kimi For Coding
/too large for model with \d+ maximum context length/i, // Mistral
/model_context_window_exceeded/i, // z.ai non-standard finish_reason surfaced as error text
/context[_ ]length[_ ]exceeded/i, // Generic fallback
/too many tokens/i, // Generic fallback
/token limit exceeded/i, // Generic fallback