Skip to content

Open-source Python library for AI browser agents, plus Browser Use Cloud: stealth browsers and a hosted agent API.

fix(llm): preserve zero retries for Anthropic Bedrock

cosin20775ec35bea5615
diff --git a/browser_use/llm/aws/chat_anthropic.py b/browser_use/llm/aws/chat_anthropic.py
index 48f21dc9a..4b673b8a1 100644
--- a/browser_use/llm/aws/chat_anthropic.py
+++ b/browser_use/llm/aws/chat_anthropic.py
@@ -89,8 +89,7 @@ class ChatAnthropicBedrock(ChatAWSBedrock):
client_params['aws_session_token'] = self.aws_session_token
# Add optional parameters
- if self.max_retries:
- client_params['max_retries'] = self.max_retries
+ client_params['max_retries'] = self.max_retries
if self.default_headers:
client_params['default_headers'] = self.default_headers
if self.default_query:
diff --git a/tests/ci/models/test_chat_anthropic_bedrock_client_config.py b/tests/ci/models/test_chat_anthropic_bedrock_client_config.py
new file mode 100644
index 000000000..9657c68b8
--- /dev/null
+++ b/tests/ci/models/test_chat_anthropic_bedrock_client_config.py
@@ -0,0 +1,14 @@
+from browser_use.llm.aws.chat_anthropic import ChatAnthropicBedrock
+
+
+def test_get_client_preserves_zero_max_retries() -> None:
+ llm = ChatAnthropicBedrock(
+ aws_access_key='test-access-key',
+ aws_secret_key='test-secret-key',
+ aws_region='us-east-1',
+ max_retries=0,
+ )
+
+ client = llm.get_client()
+
+ assert client.max_retries == 0