Skip to content

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

fixed pyright issues

Saurav Panda2a5768f3da0d
diff --git a/browser_use/browser/watchdogs/default_action_watchdog.py b/browser_use/browser/watchdogs/default_action_watchdog.py
index 05217658f..7a1ef034f 100644
--- a/browser_use/browser/watchdogs/default_action_watchdog.py
+++ b/browser_use/browser/watchdogs/default_action_watchdog.py
@@ -1890,7 +1890,12 @@ class DefaultActionWatchdog(BaseWatchdog):
# yet is longer, the field had pre-existing text that wasn't cleared. Set directly.
if clear and not is_sensitive and input_coordinates and 'actual_value' in input_coordinates:
actual_value = input_coordinates['actual_value']
- if actual_value is not None and actual_value != text and len(actual_value) > len(text) and text in actual_value:
+ if (
+ isinstance(actual_value, str)
+ and actual_value != text
+ and len(actual_value) > len(text)
+ and text in actual_value
+ ):
self.logger.info(f'🔄 Concatenation detected: got "{actual_value}", expected "{text}" — auto-retrying')
try:
# Clear + set value via native setter in one JS call (works with React/Vue)