Skip to content

Commit d98bd4b

Browse files
authored
fix: add additional context overflow cases, remove overcorrecting ones (#13077)
1 parent 22125d1 commit d98bd4b

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

packages/opencode/src/provider/error.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,13 @@ export namespace ProviderError {
1212
/input token count.*exceeds the maximum/i, // Google (Gemini)
1313
/maximum prompt length is \d+/i, // xAI (Grok)
1414
/reduce the length of the messages/i, // Groq
15-
/maximum context length is \d+ tokens/i, // OpenRouter
15+
/maximum context length is \d+ tokens/i, // OpenRouter, DeepSeek
1616
/exceeds the limit of \d+/i, // GitHub Copilot
1717
/exceeds the available context size/i, // llama.cpp server
1818
/greater than the context length/i, // LM Studio
1919
/context window exceeds limit/i, // MiniMax
20-
/exceeded model token limit/i, // Kimi For Coding
20+
/exceeded model token limit/i, // Kimi For Coding, Moonshot
2121
/context[_ ]length[_ ]exceeded/i, // Generic fallback
22-
/too many tokens/i, // Generic fallback
23-
/token limit exceeded/i, // Generic fallback
2422
]
2523

2624
function isOpenAiErrorRetryable(e: APICallError) {

0 commit comments

Comments
 (0)