Skip to content

make chrome perm flow work w multiple profiles#47

Open
laithrw wants to merge 1 commit into
mainfrom
chrome-perm-prompt-clarify
Open

make chrome perm flow work w multiple profiles#47
laithrw wants to merge 1 commit into
mainfrom
chrome-perm-prompt-clarify

Conversation

@laithrw
Copy link
Copy Markdown
Member

@laithrw laithrw commented Jun 3, 2026

Summary by cubic

Improve Local Chrome connection flow to work reliably with multiple profiles. Adds clear routing for permission and connection states so the right window gets the "Allow remote debugging?" prompt.

  • Bug Fixes
    • Route by candidate fields for cases A/B and by connect attempt state for case C (permission-blocked/403).
    • Prompt for a profile via browser local profiles and wait for selection (on launch, in cases B/C, and before page work if already connected).
    • Open a new window in the chosen profile via shell using --profile-directory, with OS-specific commands.
    • Refine steps:
      • A: Launch Chrome, then retry before considering other cases.
      • B: Only use chrome://inspect/#remote-debugging when browser_running: true and remote_debugging_enabled: false.
      • C: If 403, instruct user to click Allow on the popup; do not send them to chrome://inspect.

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

Review in cubic

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 1 file

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="crates/browser-use-agent/src/prompts/mod.rs">

<violation number="1" location="crates/browser-use-agent/src/prompts/mod.rs:188">
P2: Case B instruction order is contradictory: one section says run `browser local setup` first, another says run `browser local profiles` before the chrome://inspect flow.</violation>
</file>

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

Fix all with cubic | Re-trigger cubic

" 2. After they confirm, retry `browser connect local`. If it still 403s, suggest they bring each Chrome window to the front in turn until they spot the popup, or close all but one Chrome window and try again.\n\n",
"Profile selection — when to run `browser local profiles`:\n",
" • Case A handles it immediately after launching Chrome (step A.2).\n",
" • Cases B and C: Chrome was already running on entry, so run `browser local profiles` as soon as you hit the case (before the chrome://inspect dance or the popup hand-holding). Same rule: if multiple profiles, ASK the user which to use and wait. If only one, proceed silently.\n",
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot Jun 3, 2026

Choose a reason for hiding this comment

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

P2: Case B instruction order is contradictory: one section says run browser local setup first, another says run browser local profiles before the chrome://inspect flow.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At crates/browser-use-agent/src/prompts/mod.rs, line 188:

<comment>Case B instruction order is contradictory: one section says run `browser local setup` first, another says run `browser local profiles` before the chrome://inspect flow.</comment>

<file context>
@@ -167,15 +167,30 @@ pub fn browser_mode_instruction(mode: &str) -> String {
+            "      2. After they confirm, retry `browser connect local`. If it still 403s, suggest they bring each Chrome window to the front in turn until they spot the popup, or close all but one Chrome window and try again.\n\n",
+            "Profile selection — when to run `browser local profiles`:\n",
+            "  • Case A handles it immediately after launching Chrome (step A.2).\n",
+            "  • Cases B and C: Chrome was already running on entry, so run `browser local profiles` as soon as you hit the case (before the chrome://inspect dance or the popup hand-holding). Same rule: if multiple profiles, ASK the user which to use and wait. If only one, proceed silently.\n",
+            "  • Connecting succeeded on the first `browser connect local` (no case A/B/C entered): still run `browser local profiles` before any `browser_script` page work and ask if there's more than one.\n\n",
+            "What to DO with the chosen profile (this is the part you must not skip):\n",
</file context>
Suggested change
" • Cases B and C: Chrome was already running on entry, so run `browser local profiles` as soon as you hit the case (before the chrome://inspect dance or the popup hand-holding). Same rule: if multiple profiles, ASK the user which to use and wait. If only one, proceed silently.\n",
" • Cases B and C: Chrome was already running on entry, so run `browser local profiles` as soon as you hit the case (before retrying `browser connect local`; for case C also before popup hand-holding). Same rule: if multiple profiles, ASK the user which to use and wait. If only one, proceed silently.\n",
Fix with cubic

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