Skip to content

fix(admin): recognize Brave in _chrome_running process check#287

Open
DanielKeith wants to merge 1 commit intobrowser-use:mainfrom
DanielKeith:fix/recognize-brave-in-doctor
Open

fix(admin): recognize Brave in _chrome_running process check#287
DanielKeith wants to merge 1 commit intobrowser-use:mainfrom
DanielKeith:fix/recognize-brave-in-doctor

Conversation

@DanielKeith
Copy link
Copy Markdown
Contributor

@DanielKeith DanielKeith commented May 3, 2026

What

browser-harness --doctor shows a misleading [FAIL] chrome running — start chrome/edge line on machines where Brave is the only Chromium-based browser running, even when the harness has connected to Brave successfully. The actual connection logic in daemon.get_ws_url() already discovers Brave's user-data-dir (added in #284), so users see a healthy active connection alongside a contradictory "no chrome" failure.

The cause is _chrome_running() in admin.py: its process-name allowlist is ("chrome.exe", "msedge.exe") on Windows and ("Google Chrome", "chrome", "chromium", "Microsoft Edge", "msedge") on POSIX — neither set matches Brave's process names.

Change

  • _chrome_running(): add brave.exe (Windows) and Brave Browser, brave-browser, brave (macOS / Linux) to the recognized set
  • Broaden docstring from "Chrome/Edge" to "Chromium-based browser"

Tests

  • New test_chrome_running_detects_brave_on_windows — monkeypatches platform.system + subprocess.check_output, asserts _chrome_running() returns True
  • New test_chrome_running_detects_brave_on_posix — same shape, Linux output with brave-browser
  • Both fail against the unmodified code (verified RED before the production change)
  • 42/42 unit tests pass after the fix

Context

Follow-up to #284, which made Brave's user-data-dir discoverable by the daemon's get_ws_url(). With #284 in place, Brave connects fine but --doctor still mis-reports chrome running.


Summary by cubic

Fixes the misleading "[FAIL] chrome running" in browser-harness --doctor when Brave is the active browser. The doctor check now recognizes Brave, so its output matches the actual connection.

  • Bug Fixes
    • Update admin._chrome_running() to include Brave processes: brave.exe (Windows) and Brave Browser, brave-browser, brave (macOS/Linux).
    • Broaden docstring to “Chromium-based browser”.
    • Add unit tests for Brave detection on Windows and POSIX.

Written for commit 0685db2. Summary will update on new commits.

The doctor's "chrome running" check used a process-name allowlist limited
to chrome/edge, so Brave users saw a misleading FAIL line even when the
harness connected to Brave successfully (the actual connection logic in
daemon.get_ws_url already discovers Brave's user-data-dir).

Add brave.exe (Windows) and Brave Browser / brave-browser / brave (POSIX
process names across macOS and Linux) to the recognized set. Also broaden
the docstring from "Chrome/Edge" to "Chromium-based browser".
Copy link
Copy Markdown
Contributor

@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.

No issues found across 2 files

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