fix: prevent retry amplification by disabling SDK retries

This commit is contained in:
pikaxinge
2026-04-04 12:36:45 +08:00
committed by Xubin Ren
parent 6fbcecc880
commit dbdf7e5955
3 changed files with 23 additions and 0 deletions
+2
View File
@@ -49,6 +49,8 @@ class AnthropicProvider(LLMProvider):
client_kw["base_url"] = api_base
if extra_headers:
client_kw["default_headers"] = extra_headers
# Keep retries centralized in LLMProvider._run_with_retry to avoid retry amplification.
client_kw["max_retries"] = 0
self._client = AsyncAnthropic(**client_kw)
@staticmethod
@@ -135,6 +135,7 @@ class OpenAICompatProvider(LLMProvider):
api_key=api_key or "no-key",
base_url=effective_base,
default_headers=default_headers,
max_retries=0,
)
def _setup_env(self, api_key: str, api_base: str | None) -> None: