fix(browser): read Windows Chrome version from build dir in doctor by MukundaKatta · Pull Request #87937 · openclaw/openclaw · GitHub
Skip to content

fix(browser): read Windows Chrome version from build dir in doctor - #87937

Merged
steipete merged 3 commits into
openclaw:mainfrom
MukundaKatta:fix/doctor-windows-chrome-version
Jul 6, 2026
Merged

steipete merged 3 commits into
openclaw:mainfrom
MukundaKatta:fix/doctor-windows-chrome-version

Conversation

@MukundaKatta

Copy link
Copy Markdown
Contributor

Summary

  • openclaw doctor on Windows reports Could not determine the installed Chrome version. Chrome MCP requires Google Chrome 144+ on this host. even when a supported Chrome (e.g. 148.0.7778.179) is installed at the standard path and the browser tool itself connects and works fine. See [Bug]: openclaw doctor reports "Could not determine the installed Chrome version" despite Chrome 148 installed at expected path #87312.
  • Root cause: readBrowserVersion() resolves the version by running chrome.exe --version. On macOS/Linux that prints the version to stdout, but on Windows the GUI binary does not attach to the parent console, so --version produces no stdout and detection returns null.
  • Fix: add a win32 branch to readBrowserVersion() that reads the version from the Chromium install layout (the newest sibling Application\<version> build directory), falling back to the executable's file metadata via PowerShell ProductVersion for non-standard/portable layouts. This mirrors the existing darwin branch, which already reads the app bundle Info.plist instead of --version.
  • Out of scope: the minimum-version policy and the macOS/Linux code paths are unchanged.
  • Success: on Windows, doctor detects Chrome 144+ and stops emitting the false warning; other platforms behave exactly as before.
  • Reviewer focus: the new readWindowsBrowserVersion() helper and the win32 branch in readBrowserVersion() in extensions/browser/src/browser/chrome.executables.ts.

Linked context

Closes #87312

Was this requested by a maintainer or owner? No; community bug report.

Real behavior proof (required for external PRs)

  • Behavior or issue addressed: doctor false positive "Could not determine the installed Chrome version" on Windows with a working Chrome install.
  • Real environment tested: macOS (development host). The Windows-specific path was exercised by unit tests, not on a live Windows host (I do not have a Windows machine available).
  • Exact steps or command run after this patch:
    • pnpm test extensions/browser/src/browser/chrome.version.test.ts
    • pnpm test extensions/browser/src/doctor-browser.test.ts
    • pnpm tsgo, oxlint, oxfmt --check on the touched files
  • Evidence after fix:
    • New on Windows unit tests in chrome.version.test.ts stub process.platform = "win32" and build a real temporary directory mirroring the Application\<version> install layout. They assert that readBrowserVersion():
      • derives the newest version from sibling build directories using numeric (not lexical) ordering, and does not spawn PowerShell when a version directory exists;
      • falls back to powershell.exe ... (Get-Item -LiteralPath '<exe>').VersionInfo.ProductVersion when no version directory exists;
      • returns null when neither signal is available.
    • Results: chrome.version.test.ts 6 passed; doctor-browser.test.ts 11 passed; tsgo 0 errors; oxlint 0 errors; oxfmt --check clean.
  • Observed result after fix: on the simulated Windows layout readBrowserVersion() returns e.g. 148.0.7778.179, so parseBrowserMajorVersion() yields 148 >= 144 and doctor would not emit the warning.
  • What was not tested: a live Windows host with a real Chrome install. The PowerShell command was not executed against a real chrome.exe; the fallback is covered via a mocked execFileSync.
  • Proof limitations: I cannot run Windows locally, so the version-directory layout and the PowerShell ProductVersion fallback are validated by unit tests and the well-documented Chromium-on-Windows --version behavior rather than a live run. Live confirmation on a Windows host would strengthen this PR; happy to adjust if a maintainer can reproduce.

@openclaw-barnacle openclaw-barnacle Bot added size: S triage: mock-only-proof Candidate: PR proof only shows tests, mocks, snapshots, lint, typecheck, or CI. labels May 29, 2026
@clawsweeper

clawsweeper Bot commented May 29, 2026 •

Copy link
Copy Markdown
Contributor

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels May 29, 2026
@clawsweeper

clawsweeper Bot commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

@MukundaKatta thanks for the PR. ClawSweeper is still waiting on real behavior proof before this can move forward.

Useful proof can be a screenshot, short video, terminal output, copied live output, linked artifact, or redacted logs that show the changed behavior after the fix. Please redact private tokens, phone numbers, private endpoints, customer data, and anything else sensitive.

Once proof is added to the PR body or a comment, ClawSweeper or a maintainer can re-check it.

MukundaKatta and others added 3 commits July 6, 2026 11:57
Read PE ProductVersion before a conservative unambiguous install-layout fallback, without interpolating configured paths into PowerShell code.\n\nCo-authored-by: Mukunda Rao Katta <mukunda.vjcs6@gmail.com>
@steipete
steipete force-pushed the fix/doctor-windows-chrome-version branch from f5affd4 to e98cd25 Compare July 6, 2026 15:58
@steipete

steipete commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Land-ready proof for source head e98cd251d8795716efddd30f54d3b41a232b9a41:

  • Reworked the Windows path to read the inspected executable's authoritative PE ProductVersion, pass the browser path as a separate PowerShell argument, and invoke the absolute trusted Windows PowerShell path. The install-directory fallback now accepts exactly one version directory and refuses ambiguous update layouts.
  • Sanitized AWS Crabbox run run_c76c79e38fe7 on lease cbx_e742eae2ef1d: 18/18 focused assertions passed (chrome.version 7, doctor-browser 11) at the exact source head.
  • Native Azure Windows Server 2022 proof on Crabbox lease cbx_973fa20271d8 (golden-barnacle-89b8), with Node 24.15.0 and Chrome installed from Google's current Enterprise MSI: the five Windows-owned/version-detection assertions passed against Chrome 150.0.7871.47.
  • Source-blind live harness: direct chrome.exe --version timed out after 10 seconds with zero stdout bytes, while the PR's PE metadata path returned 150.0.7871.47; openclaw doctor --non-interactive reported that exact version and emitted no unknown-version warning.
  • The same isolated config started a healthy Dev Gateway. A real OpenAI gpt-5.4-mini agent crossed the Gateway WebSocket, invoked Browser tabs against the real Chrome CDP endpoint, grounded WINDOWS_BROWSER_OK in a distinct live URL marker, and persisted the Browser tool call/result in the trajectory. Final harness result: WINDOWS_LIVE_RESULT=PASS.
  • Fresh autoreview after the absolute-PowerShell hardening: no actionable findings. Current GitHub checks: 65 successful, 30 skipped, 1 neutral, no failures or pending checks.

Known proof detail: the first broad native-Windows test invocation exposed three pre-existing POSIX-only test-fixture assumptions (a macOS Plist path and two /tmp doctor fixtures). The Windows-owned cases and product behavior above pass; those unrelated fixture failures are not hidden or counted as green.

Implementation: extensions/browser/src/browser/chrome.executables.ts:747; regression coverage: extensions/browser/src/browser/chrome.version.test.ts:91.

@steipete
steipete merged commit 675045f into openclaw:main Jul 6, 2026
96 checks passed
@steipete

steipete commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 7, 2026
…penclaw#87937)

* fix(browser): read Windows Chrome version metadata

Read PE ProductVersion before a conservative unambiguous install-layout fallback, without interpolating configured paths into PowerShell code.\n\nCo-authored-by: Mukunda Rao Katta <mukunda.vjcs6@gmail.com>

* style(browser): clarify Windows version probe

* fix(browser): use trusted Windows PowerShell path

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: S status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. triage: mock-only-proof Candidate: PR proof only shows tests, mocks, snapshots, lint, typecheck, or CI.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: openclaw doctor reports "Could not determine the installed Chrome version" despite Chrome 148 installed at expected path

2 participants