Skip to content

fix local Chrome profile targeting#65

Merged
laithrw merged 4 commits into
mainfrom
improved-target
Jun 5, 2026
Merged

fix local Chrome profile targeting#65
laithrw merged 4 commits into
mainfrom
improved-target

Conversation

@laithrw
Copy link
Copy Markdown
Member

@laithrw laithrw commented Jun 4, 2026

  • Fall back to normal local connect when profile discovery fails
  • Cache the TUI browser profile label instead of reading settings during render
  • Validate CDP createTarget params before adding browserContextId
  • Use a short HTTPS marker URL for profile targeting
  • Inject the existing Browser Use startup animation after attaching

Summary by cubic

Tightens local Chrome profile targeting and recovery. Requires a default profile before connecting or running scripts, focuses the right profile for permission prompts, reuses targets/endpoints, and now blocks local connect when profile discovery fails.

  • Bug Fixes

    • browser-use-agent: require a default local profile before browser connect local or script start; if browser local profiles --json errors or returns status: "failed", block with state: "profile-discovery-failed" and do not connect; add default_profile_id to browser local profiles --json with guidance not to ask the user to pick; on permission-blocked, return a profile_recovery_command (browser local open --profile <id> --no-marker) and instruct an immediate browser connect local retry; if a connect succeeds in the wrong profile, block with profile-target-missing and recovery guidance; added tests.
    • browser-use-browser: use a short HTTPS marker URL on the Browser Use site, inject the startup animation after attach, reuse the current placeholder target to avoid extra tabs, prefer endpoint reuse by HTTP base URL even if the WS ID changes, refresh checked-out snapshots to drop stale connections; validate CDP Target.createTarget params are an object, only inject browserContextId when safe, and reject mismatched contexts; added tests.
    • browser-use-tui: cache the browser profile label in memory and refresh on settings changes; cancelling a live run marks the session cancelled in the store and updates the UI; added tests.
  • Refactors

    • browser-use-browser: add profile_marker_target_url and helpers for endpoint health/reuse; remove an unnecessary reattach step before work; expand test coverage.

Written for commit 9540337. Summary will update on new commits.

Review in cubic

- Fall back to normal local connect when profile discovery fails
- Cache the TUI browser profile label instead of reading settings during render
- Validate CDP createTarget params before adding browserContextId
- Use a short HTTPS marker URL for profile targeting
- Inject the existing Browser Use startup animation after attaching
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 4 files

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread crates/browser-use-tui/src/main.rs
- Marker tab w animation on live website
- Require default-profile selection before local browser work
- Reuse/focus the selected profile more carefully during reconnects
- Avoid extra CDP prompts and duplicate placeholder tabs where possible
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

2 issues found across 5 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread crates/browser-use-agent/src/tools/handlers/browser.rs
Comment thread crates/browser-use-browser/src/browser_script_helpers.py
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 2 files (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Fix all with cubic | Re-trigger cubic

Comment thread crates/browser-use-agent/src/tools/handlers/browser.rs Outdated
@laithrw laithrw merged commit 5b536d4 into main Jun 5, 2026
6 checks passed
@laithrw laithrw deleted the improved-target branch June 5, 2026 14:31
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.

1 participant