fix: add retry for Anthropic streaming connection errors (#543)

Co-authored-by: Letta <noreply@letta.com>
This commit is contained in:
Charles Packer
2026-01-14 13:28:18 -08:00
committed by GitHub
parent c24d4707de
commit 38b86b756e
2 changed files with 2 additions and 0 deletions

View File

@@ -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;

View File

@@ -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),