fix: add retry for Anthropic streaming connection errors (#543)
Co-authored-by: Letta <noreply@letta.com>
This commit is contained in:
@@ -255,6 +255,7 @@ async function isRetriableError(
|
||||
"overloaded", // anthropic_client.py:753 - used for LLMProviderOverloaded
|
||||
"api_error", // Anthropic SDK error type field
|
||||
"Network error", // Transient network failures during streaming
|
||||
"Connection error during Anthropic streaming", // Peer disconnections, incomplete chunked reads
|
||||
];
|
||||
if (llmProviderPatterns.some((pattern) => detail.includes(pattern))) {
|
||||
return true;
|
||||
|
||||
@@ -1173,6 +1173,7 @@ export async function handleHeadlessCommand(
|
||||
"overloaded", // anthropic_client.py:753 - used for LLMProviderOverloaded
|
||||
"api_error", // Anthropic SDK error type field
|
||||
"Network error", // Transient network failures during streaming
|
||||
"Connection error during Anthropic streaming", // Peer disconnections, incomplete chunked reads
|
||||
];
|
||||
const isLlmErrorFromDetail = llmProviderPatterns.some((pattern) =>
|
||||
detail.includes(pattern),
|
||||
|
||||
Reference in New Issue
Block a user