Skip to content

fix(browser): read Windows browser version when path has spaces - #160401

Closed
Ayushdevo wants to merge 1 commit into
openclaw:mainfrom
Ayushdevo:fix/windows-browser-version-probe-160377
Closed

Ayushdevo wants to merge 1 commit into
openclaw:mainfrom
Ayushdevo:fix/windows-browser-version-probe-160377

Conversation

@Ayushdevo

Copy link
Copy Markdown
Contributor

Closes #160377

What Problem This Solves

Fixes the Windows browser version probe failing for paths with spaces, including Chrome's default C:\Program Files installation, and printing a PowerShell parse error during doctor --json.

User Impact

The browser path is passed to PowerShell through a child-process environment variable instead of being appended to the -Command program. Probe stderr is captured, so a failed metadata read falls back without printing into command output.

Why This Change Was Made

Windows PowerShell 5.1 treats text after -Command as part of the script; the old $args[0] was empty and an unquoted path became script text. The existing fallback for version directories remains.

Evidence

  • Updated the existing Windows version test to assert the exact argument list, child environment, and captured stderr configuration for a path containing spaces and an apostrophe.
  • Locally verified with Node that execFileSync with stdio: ["ignore","pipe","pipe"] captures a failing child's stderr without echoing it.
  • No Windows host or OpenClaw dependency checkout is available here; the focused Vitest suite and an actual PowerShell 5.1 probe are unverified. CI and Windows verification remain necessary.

@clawsweeper

clawsweeper Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 28, 2026
@clawsweeper

clawsweeper Bot commented Sep 28, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed September 28, 2026, 7:44 AM ET / 11:44 UTC.

ClawSweeper review

What this changes

The browser plugin passes the Windows browser executable path to PowerShell through an environment variable and captures probe stderr, with an updated version-probe test.

Merge readiness

⛔ Blocked before merge - 2 items remain

Current main and the latest release still contain the reported Windows PowerShell failure path. This PR is a focused candidate fix with no demonstrated patch defect, but its after-fix behavior has not been shown on Windows.

Priority: P2
Reviewed head: 5949f36af375696be804c297aebece77df58d2d9

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The focused patch looks sound, while the platform behavior it repairs remains unproven after the change.
Proof confidence 🦪 silver shellfish (2/6) Needs stronger real behavior proof before merge: The changed browser probe is reached through Doctor's Chrome version check, but the PR shows only mocked call-shape assertions and reports a separate local Node stderr check. It supplies no observable after-fix Windows PowerShell 5.1 or Doctor result. A redacted terminal capture of the real path, including the version and clean stderr, would close this gap; private paths, endpoints, and credentials should be removed. No stored-data contract changes. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Needs proof Needs stronger real behavior proof before merge: The changed browser probe is reached through Doctor's Chrome version check, but the PR shows only mocked call-shape assertions and reports a separate local Node stderr check. It supplies no observable after-fix Windows PowerShell 5.1 or Doctor result. A redacted terminal capture of the real path, including the version and clean stderr, would close this gap; private paths, endpoints, and credentials should be removed. No stored-data contract changes. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 7 items Introduced patch: The pinned PR delta changes the PowerShell argument transport and stderr handling, plus the corresponding mocked test. The verified test merge changes only these two files relative to its main parent.
Current main still affected: Current main passes the executable path after PowerShell's -Command text and has no explicit stderr capture in the shared probe.
Doctor entry point: Browser Doctor reads the discovered Chrome executable's version and reports whether it could determine a suitable version.
Findings None None.
Security None None.

How this fits together

The browser plugin finds a local Chrome executable and reads its version for Doctor's browser readiness report. If metadata lookup fails, it can infer a version from an unambiguous installation directory.

flowchart LR
A[Browser configuration] --> B[Chrome executable discovery]
B --> C[Windows version probe]
C --> D{Metadata readable?}
D -->|Yes| E[Doctor version report]
D -->|No| F[Version directory fallback]
F --> E
Loading

Before merge

  • Add real behavior proof - Needs stronger real behavior proof before merge: The changed browser probe is reached through Doctor's Chrome version check, but the PR shows only mocked call-shape assertions and reports a separate local Node stderr check. It supplies no observable after-fix Windows PowerShell 5.1 or Doctor result. A redacted terminal capture of the real path, including the version and clean stderr, would close this gap; private paths, endpoints, and credentials should be removed. No stored-data contract changes. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Complete next step (P2) - Provide redacted after-fix Windows PowerShell 5.1 evidence through OpenClaw's browser Doctor path, with the detected version and quiet stderr, and add the focused test result and measured cost to the PR body. Updating the body should trigger re-review; if it does not, ask a maintainer to comment @clawsweeper re-review.
Agent review details

Security

None.

PR surface

Source +4, Tests +3. Total +7 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 6 2 +4
Tests 1 6 3 +3
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 12 5 +7

Review metrics

None.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #160377
Summary: This PR explicitly targets the open Windows browser version-probe report and changes the reported call path.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Technical review

Best possible solution:

Browser Doctor should report the installed Chrome version for ordinary Windows paths with spaces while keeping its JSON diagnostics free of probe stderr and retaining the directory fallback for genuine metadata failures.

Do we have a high-confidence way to reproduce the issue?

Yes. The linked report supplies a Windows 11 and PowerShell 5.1 command and ParserError, and current main retains the triggering invocation; this review did not independently run Windows.

Is this the best way to solve the issue?

Yes, provisionally. Passing the path as data and capturing stderr repairs the existing probe at its owner; an actual Windows after-fix run is still needed to confirm the result.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 659f4b73d8e2.

Labels

Label changes:

  • add P2: This is a bounded Windows browser diagnostic fix with a clear reported failure and limited blast radius.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: The changed browser probe is reached through Doctor's Chrome version check, but the PR shows only mocked call-shape assertions and reports a separate local Node stderr check. It supplies no observable after-fix Windows PowerShell 5.1 or Doctor result. A redacted terminal capture of the real path, including the version and clean stderr, would close this gap; private paths, endpoints, and credentials should be removed. No stored-data contract changes. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Label justifications:

  • P2: This is a bounded Windows browser diagnostic fix with a clear reported failure and limited blast radius.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: The changed browser probe is reached through Doctor's Chrome version check, but the PR shows only mocked call-shape assertions and reports a separate local Node stderr check. It supplies no observable after-fix Windows PowerShell 5.1 or Doctor result. A redacted terminal capture of the real path, including the version and clean stderr, would close this gap; private paths, endpoints, and credentials should be removed. No stored-data contract changes. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 9df2012 adds extensions/browser/src/browser/chrome.executable-probe.ts:67 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 9df201214f6d; files: extensions/browser/src/browser/chrome.executable-probe.ts)
  • Jason (Json): Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Add a redacted Windows PowerShell 5.1 run through the browser Doctor path that shows the detected version and no parser error, and report the focused test result and measured cost.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@obviyus

obviyus commented Sep 28, 2026

Copy link
Copy Markdown
Collaborator

Thanks @Ayushdevo. This fix landed through #160432 (68a9ce0), which takes the same approach (passing the executable path through an environment variable instead of an appended -Command argument), also keeps failed probe output out of stderr, and adds native Windows CI tests. You're credited in #160432's description. Closing this one as superseded.

@obviyus obviyus closed this Sep 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: browser P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: XS status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

2 participants