Skip to content

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

minor fixes for proxy models and positional args in google sheets actions

Nick Sweeting472d462fa7a4
diff --git a/browser_use/controller/service.py b/browser_use/controller/service.py
index c316a6ed1..a5e4ea127 100644
--- a/browser_use/controller/service.py
+++ b/browser_use/controller/service.py
@@ -781,8 +781,9 @@ class Controller(Generic[Context]):
@self.registry.action('Google Sheets: Select a specific cell or range of cells', domains=['sheets.google.com'])
async def select_cell_or_range(browser_session: BrowserSession, cell_or_range: str):
- # Don't pass browser_session by name to avoid the multiple values error
- return await _select_cell_or_range(browser_session, cell_or_range=cell_or_range)
+ # Pass browser_session positionally to avoid the "multiple values" error
+ # This prevents the error when Registry.execute_action also includes browser_session in extra_args
+ return await _select_cell_or_range(browser_session, cell_or_range)
@self.registry.action(
'Google Sheets: Get the contents of a specific cell or range of cells', domains=['sheets.google.com']
@@ -817,8 +818,8 @@ class Controller(Generic[Context]):
async def update_range_contents(browser_session: BrowserSession, range: str, new_contents_tsv: str):
page = await browser_session.get_current_page()
- # Don't pass browser_session by name to avoid the multiple values error
- await select_cell_or_range(browser_session, cell_or_range=range)
+ # Pass browser_session positionally to avoid the "multiple values" error
+ await select_cell_or_range(browser_session, range)
# simulate paste event from clipboard with TSV content
await page.evaluate(f"""
diff --git a/tests/test_browser_config_models.py b/tests/test_browser_config_models.py
index 02d2279bd..a32852138 100644
--- a/tests/test_browser_config_models.py
+++ b/tests/test_browser_config_models.py
@@ -12,9 +12,7 @@ async def test_proxy_settings_pydantic_model():
Test that ProxySettings as a Pydantic model is correctly converted to a dictionary when used.
"""
# Create ProxySettings with Pydantic model
- proxy_settings = ProxySettings(
- server='http://example.proxy:8080', bypass='localhost', username='testuser', password='testpass'
- )
+ proxy_settings = dict(server='http://example.proxy:8080', bypass='localhost', username='testuser', password='testpass')
# Verify the model has correct dict-like access
assert proxy_settings['server'] == 'http://example.proxy:8080'
@@ -22,7 +20,7 @@ async def test_proxy_settings_pydantic_model():
assert proxy_settings.get('nonexistent', 'default') == 'default'
# Verify model_dump works correctly
- proxy_dict = proxy_settings.model_dump()
+ proxy_dict = dict(proxy_settings)
assert isinstance(proxy_dict, dict)
assert proxy_dict['server'] == 'http://example.proxy:8080'
assert proxy_dict['bypass'] == 'localhost'