Add OAuth providers to test suite and improve test coverage

Tests updated:
- abort.test.ts: Add Google Gemini CLI, add retries
- agent.test.ts: Add OAuth providers (Anthropic, GitHub Copilot, Gemini CLI, Antigravity), add retries, remove timeouts
- context-overflow.test.ts: Handle Cerebras 429 status code
- image-tool-result.test.ts: Add OAuth providers
- overflow.ts: Detect 429 as overflow for Cerebras

Removed obsolete debug/one-off tests:
- copilot-initiator.test.ts
- gemini-3-flash-tool-calling.test.ts
- google-thought-signature.test.ts
- mistral-debug.test.ts
- mistral-empty-assistant.test.ts
- mistral-sdk.test.ts
This commit is contained in:
Mario Zechner 2025-12-20 21:15:40 +01:00
parent fb1fdb6006
commit 6a319f9c3c
11 changed files with 239 additions and 1505 deletions

View file

@ -54,8 +54,8 @@ const OVERFLOW_PATTERNS = [
* - Google Gemini: "input token count exceeds the maximum"
* - xAI (Grok): "maximum prompt length is X but request contains Y"
* - Groq: "reduce the length of the messages"
* - Cerebras: 400/413 status code (no body)
* - Mistral: 400/413 status code (no body)
* - Cerebras: 400/413/429 status code (no body)
* - Mistral: 400/413/429 status code (no body)
* - OpenRouter (all backends): "maximum context length is X tokens"
* - llama.cpp: "exceeds the available context size"
* - LM Studio: "greater than the context length"
@ -89,8 +89,9 @@ export function isContextOverflow(message: AssistantMessage, contextWindow?: num
return true;
}
// Cerebras and Mistral return 400/413 with no body - check for status code pattern
if (/^4(00|13)\s*(status code)?\s*\(no body\)/i.test(message.errorMessage)) {
// Cerebras and Mistral return 400/413/429 with no body - check for status code pattern
// 429 can indicate token-based rate limiting which correlates with context overflow
if (/^4(00|13|29)\s*(status code)?\s*\(no body\)/i.test(message.errorMessage)) {
return true;
}
}