Skip to content

fix(diffs): find Windows browsers when install roots are blank#111257

Open
LZY3538 wants to merge 1 commit into
openclaw:mainfrom
LZY3538:codex/diffs-blank-programfiles
Open

fix(diffs): find Windows browsers when install roots are blank#111257
LZY3538 wants to merge 1 commit into
openclaw:mainfrom
LZY3538:codex/diffs-blank-programfiles

Conversation

@LZY3538

@LZY3538 LZY3538 commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where the diffs plugin could fail to find an installed Windows browser when LOCALAPPDATA or ProgramFiles environment entries were present but blank.

Why This Change Was Made

The plugin now treats blank Windows install roots as absent, omits the unsafe relative LOCALAPPDATA candidate, and retains the standard Program Files fallbacks. The change stays inside the diffs plugin boundary.

User Impact

Diff image and PDF rendering can launch the system browser on Windows even under services that export blank install-root variables.

Evidence

  • Base behavior: the production screenshot path launched Playwright without an executablePath even though the standard Chrome path was available.
  • Exact head 8124505: full adjacent suite -> 11 of 11 passed on Windows after making Windows path joining platform-explicit.
  • Command: node scripts/run-vitest.mjs extensions/diffs/src/browser.test.ts -- -t uses-standard-Windows-install-roots
  • The test drives PlaywrightDiffScreenshotter through screenshotHtml, exposes only C:\Program Files\Google\Chrome\Application\chrome.exe, verifies that path reaches chromium.launch, and verifies no relative LOCALAPPDATA candidate is probed.
  • Targeted oxfmt check and git diff --check passed.

Real Windows production proof

Ran the production PlaywrightDiffScreenshotter on Windows with LOCALAPPDATA set to whitespace, both ProgramFiles roots blank, all explicit browser-path variables blank, and PATH empty.

Observed redacted output:

  • platform: win32
  • standard Chrome present: true
  • screenshotHtml completed: 2,637-byte PNG; signature 89504e470d0a1a0a
  • live headless browser executable: C:\Program Files\Google\Chrome\Application\chrome.exe
  • the temporary PNG and proof directory were removed after verification

This proves the production resolver selected the standard fallback, launched the real installed Chrome binary, and completed a real render without PATH or environment-root discovery assistance.

@LZY3538
LZY3538 force-pushed the codex/diffs-blank-programfiles branch from a34affc to 8124505 Compare July 19, 2026 06:51
@clawsweeper clawsweeper Bot added 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. P2 Normal backlog priority with limited blast radius. labels Jul 19, 2026
@clawsweeper

clawsweeper Bot commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 19, 2026, 3:55 AM ET / 07:55 UTC.

Summary
The PR normalizes blank Windows browser-install environment roots, omits an unsafe relative LOCALAPPDATA candidate, uses path.win32.join, and adds a regression test for standard Chrome fallback discovery.

PR surface: Source +11, Tests +44. Total +55 across 2 files.

Reproducibility: yes. from the supplied source-level scenario: on Windows, set the three install-root variables to blank values while a standard Chrome executable remains available; the expected result is that screenshotHtml launches that standard browser path rather than probing a relative path.

Review metrics: none identified.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🦞 diamond lobster
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • none.

Next step before merge

  • [P2] No concrete repair task is identified; this PR needs the normal maintainer merge decision against the current base.

Security
Cleared: The two-file diff changes local browser-path selection and a unit test; it adds no dependency, workflow, secret, permission, download, or package-resolution surface.

Review details

Best possible solution:

Land the focused plugin-boundary fix once the current-base review and required checks confirm that the resolver and regression test still apply cleanly.

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

Yes, from the supplied source-level scenario: on Windows, set the three install-root variables to blank values while a standard Chrome executable remains available; the expected result is that screenshotHtml launches that standard browser path rather than probing a relative path.

Is this the best way to solve the issue?

Yes, based on the supplied patch: normalizing optional environment values at the resolver boundary, skipping the invalid local candidate, and retaining documented Windows defaults is narrower and safer than adding configuration or changing Playwright behavior.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 58452de71188.

Label changes

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.

Label justifications:

  • P2: This is a bounded Windows rendering reliability fix with a limited blast radius in the diffs plugin.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body provides a concrete after-fix Windows production run showing the selected standard Chrome executable and successful PNG rendering under the blank-root conditions; redact equivalent environment and path details in any future attached evidence.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body provides a concrete after-fix Windows production run showing the selected standard Chrome executable and successful PNG rendering under the blank-root conditions; redact equivalent environment and path details in any future attached evidence.
Evidence reviewed

PR surface:

Source +11, Tests +44. Total +55 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 21 10 +11
Tests 1 44 0 +44
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 65 10 +55

What I checked:

  • Changed resolver behavior: The PR changes commonExecutablePathsForPlatform() to treat whitespace-only LOCALAPPDATA, ProgramFiles, and ProgramFiles(x86) values as absent; it omits the local-app-data candidate when absent and retains the two standard Program Files roots. (extensions/diffs/src/browser.ts:521, 81245059e84b)
  • Regression coverage: The added test simulates Windows with blank install-root variables, exposes only the standard Chrome path, verifies that Chromium launches with that path, and checks that no relative LOCALAPPDATA candidate is probed. (extensions/diffs/src/browser.test.ts:69, 81245059e84b)
  • Real Windows behavior proof: The PR body reports a production PlaywrightDiffScreenshotter run on Windows with blank roots and empty PATH, selecting C:\Program Files\Google\Chrome\Application\chrome.exe and producing a valid PNG. (extensions/diffs/src/browser.ts:521, 81245059e84b)
  • Review continuity: The prior ClawSweeper cycle reviewed the same head and found no code-level findings; the subsequent proof update was accepted and the PR now carries proof: sufficient. (extensions/diffs/src/browser.test.ts:69, 81245059e84b)

Likely related people:

  • unresolved: The available PR context identifies the proposed change but does not provide enough current-main blame or log evidence to attribute ownership of the existing diffs browser resolver without guessing. (role: current-main history owner not established; confidence: low; files: extensions/diffs/src/browser.ts, extensions/diffs/src/browser.test.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • 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.
Review history (3 earlier review cycles)
  • reviewed 2026-07-19T06:55:29.953Z sha 8124505 :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-19T07:04:01.388Z sha 8124505 :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-19T07:12:00.582Z sha 8124505 :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed 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 Jul 19, 2026
@openclaw-barnacle openclaw-barnacle Bot reopened this Jul 19, 2026
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Jul 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: diffs P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant