Skip to content

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

fall back to raw profile value when Chrome metadata can't be read

ShawnPanadbb356d2eb20
diff --git a/browser_use/skill_cli/sessions.py b/browser_use/skill_cli/sessions.py
index 5e9d69f46..7021e4ce5 100644
--- a/browser_use/skill_cli/sessions.py
+++ b/browser_use/skill_cli/sessions.py
@@ -67,10 +67,11 @@ async def create_browser_session(
# Resolve profile: accept directory names ("Default", "Profile 1") and
# display names ("Person 1", "Work"). Directory names take precedence.
+ # If profile metadata can't be read, fall back to using the value as-is.
known_profiles = list_chrome_profiles()
directory_names = {p['directory'] for p in known_profiles}
- if profile in directory_names:
+ if not known_profiles or profile in directory_names:
profile_directory = profile
else:
# Try case-insensitive display name match