Skip to content

--doctor reports "chrome running FAIL" and exits 1 for Brave and Chromium users, while the daemon works fine #686

Description

@rajarshidattapy

Labels: bug, doctor, ux

Description

Two functions answer the same question — "is a supported browser running?" — from two
different, inconsistent process-name lists.

The daemon's list is correct and includes everything in PROFILES:

# src/browser_harness/daemon.py:179
return any(n in out for n in ("chrome.exe", "msedge.exe", "chromium.exe", "brave.exe", "helium.exe"))

Doctor's list is a strict subset, and drops Brave on both platforms and Chromium on
Windows:

# src/browser_harness/admin.py:900-913
if system == "Windows":
    out = subprocess.check_output(["tasklist"], ...)
    names = ("chrome.exe", "msedge.exe", "helium.exe")            # no chromium.exe, no brave.exe
else:
    out = subprocess.check_output(["ps", "-A", "-o", "comm="], ...)
    names = ("Google Chrome", "chrome", "chromium", "Microsoft Edge", "msedge", "helium")  # no brave

Brave is a first-class target elsewhere in the codebase:

  • daemon._MAC_PROFILESLibrary/Application Support/BraveSoftware/Brave-Browser
  • daemon._LINUX_PROFILES.config/BraveSoftware/... (via the flatpak entry)
  • daemon._WINDOWS_PROFILESBraveSoftware/Brave-Browser/User Data
  • admin._BROWSER_LAUNCH("brave", "Brave Browser", ("brave-browser", "brave"), "brave")

So the harness will discover a Brave profile, connect to Brave over CDP, and drive it —
and then --doctor will tell the user Brave is not running.

Impact

run_doctor()'s exit code is derived from this check:

# admin.py:1152
return 0 if (chrome and daemon) else 1

A Brave user with a healthy daemon and a live browser connection gets:

  [FAIL] chrome running — start chrome/edge
  [ok  ] daemon alive
  [ok  ] active browser connections — 1

exit code 1. install.md and SKILL.md both direct agents to --doctor as the
diagnostic when something looks wrong, so the agent is handed a false failure and a
"start chrome/edge" instruction while its browser is already attached and working.
The row directly below it contradicting the FAIL makes it worse, not better.

Windows Chromium users hit the same thing (chromium.exe is missing from doctor's list
but present in the daemon's).

Suggested fix

There should be one list, not two. admin._chrome_running() should call
daemon.supported_browser_running() — it already imports from .daemon in several
places — or both should read a shared constant. Either way, add brave.exe/brave and
chromium.exe.

Secondary: run_doctor() exiting 1 on the process-name check while
active browser connections is non-zero is backwards. A live CDP connection is stronger
evidence than a tasklist substring match, and should be able to satisfy the health
check on its own — run_doctor_json() already gets this right
(healthy = browser_ready or (chrome and daemon), admin.py:1166).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions