Skip to content

Refactor BrowserSession to remove Playwright in favor of cdp-use and bubus #2573

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 200 commits into
base: main
Choose a base branch
from

Conversation

pirate
Copy link
Member

@pirate pirate commented Jul 30, 2025

Summary by cubic

Split the BrowserSession logic into separate models for local and remote browser connections. This makes the codebase easier to maintain and extend.

  • Refactors
    • Moved local browser process management to a new LocalBrowserConnection class.
    • Moved remote CDP connection logic to a new RemoteBrowserConnection class.
    • Updated BrowserProfile with helper methods for launch and connection arguments.
    • Reduced complexity in session.py by moving connection logic to dedicated modules.

gregpr07 and others added 13 commits August 9, 2025 11:10
Auto-generated PR for branch: hot-fix/reasoning-models
    
<!-- This is an auto-generated description by cubic. -->
---

## Summary by cubic
Improved the check for reasoning models to use a case-insensitive
substring match, making model detection more reliable.

<!-- End of auto-generated description by cubic. -->
…e error handling in BaseWatchdog to manage timeouts gracefully
…detection/download. mostly coded by claude-opus-4.1
Copy link

cursor bot commented Aug 10, 2025

Bugbot found 1 bug

To see it, activate your membership in the Cursor dashboard.

@mertunsall
Copy link
Collaborator

bugbot run

)
break
)
break
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Multi-action Fails Due to Unstable Node Hashing

The multi_act method incorrectly uses Python's default hash() for EnhancedDOMTreeNode objects to detect element changes (index changes or new elements). Since these objects are recreated with each browser state snapshot, their identity-based hashes constantly change, leading to false positives. This causes multi-action sequences to prematurely abort. A stable identifier like element.element_hash should be used for comparisons instead.

Fix in Cursor Fix in Web

if name_a != name_b: # Skip self-comparison
assert name_a not in name_b, (
f'Event with name {name_a} is a substring of {name_b}, all events must be completely unique to avoid find-and-replace accidents'
)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Import Validation Fails on Non-Class Objects

The import-time validation in browser_use/browser/events.py calls issubclass() on all non-underscore globals. This causes a TypeError and crashes module import when encountering non-class objects (e.g., typing.Literal, typing.Any, pydantic.Field). The check must be guarded with inspect.isclass().

Fix in Cursor Fix in Web

MagMueller and others added 13 commits August 9, 2025 18:14
…Introduced methods for cleaning HTML, validating content relevance, and intelligently truncating long content. Enhanced markdown conversion and improved error handling for content extraction failures.
…TML to markdown conversion using markdownify, improved error handling, and streamlined memory management for extracted content. Removed obsolete methods related to HTML cleaning and content validation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants