Skip to content

πŸ™Œ OpenHands: AI-Driven Development

Fix: Retry on Bedrock ServiceUnavailableError (#9419)

Peter Hamilton66b95adbc9f9
diff --git a/openhands/llm/llm.py b/openhands/llm/llm.py
index 787e0431e4..382cfacf42 100644
--- a/openhands/llm/llm.py
+++ b/openhands/llm/llm.py
@@ -19,6 +19,7 @@ from litellm import completion as litellm_completion
from litellm import completion_cost as litellm_completion_cost
from litellm.exceptions import (
RateLimitError,
+ ServiceUnavailableError,
)
from litellm.types.utils import CostPerToken, ModelResponse, Usage
from litellm.utils import create_pretrained_tokenizer
@@ -40,6 +41,7 @@ __all__ = ['LLM']
# tuple of exceptions to retry on
LLM_RETRY_EXCEPTIONS: tuple[type[Exception], ...] = (
RateLimitError,
+ ServiceUnavailableError,
litellm.Timeout,
litellm.InternalServerError,
LLMNoResponseError,