Repository navigation
fix(browser): start Chromium from relative and hermetic Playwright caches - #164659
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed October 4, 2026, 10:05 PM ET / October 5, 2026, 02:05 UTC (Revision 3). ClawSweeper reviewWhat this changesThe browser plugin discovers Linux Chromium in relative, npm-configured, and package-local Playwright caches, with regression coverage and documentation. Merge readiness✅ Ready for maintainer review This PR remains necessary: current main lacks the requested cache discovery behavior, and the related merged fix covers only XDG caches. The scoped review found no actionable correctness or security defects, and the existing real-browser proof applies to the unchanged production source. Priority: P2 Review scores
Verification
How this fits togetherThe browser plugin selects a local Chromium executable from configuration, installed system browsers, and Playwright caches. Its launcher starts that executable in an isolated OpenClaw profile and exposes browser control through the Gateway. flowchart TD
A[Browser configuration] --> C[Executable selection]
B[System browsers and cache settings] --> C
C --> D[Resolve Playwright cache locations]
D --> E[Find executable Chromium]
E --> F[Launch isolated browser profile]
F --> G[Gateway browser control]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +20, Tests +145, Docs +4. Total +169 across 3 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep Linux executable discovery aligned with the installed Playwright locator contract while preserving configured executables, system-browser precedence, and default-cache fallback. Do we have a high-confidence way to reproduce the issue? Yes: current source misses npm aliases and hermetic caches and resolves relative caches differently from Playwright. The contributor also supplies baseline failing CLI scenarios; this review did not execute a current-main reproduction. Is this the best way to solve the issue? Yes: extending the existing executable-selection owner is a focused repair, and the independently inspected dependency contract supports the chosen semantics. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against b02eab15853b. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (2 earlier review cycles)
|
aab42d5 to
ed27ca6
Compare
ed27ca6 to
f78ffaa
Compare
|
Landed. Thanks @ly85206559! Verified on Linux arm64 with real Playwright installs: current main could not find Chromium from a relative, npm-alias or hermetic cache; with this the browser starts and |
…ches (openclaw#164659) Discover Linux Chromium installed through relative PLAYWRIGHT_BROWSERS_PATH values, npm configuration aliases, and hermetic PLAYWRIGHT_BROWSERS_PATH=0 installs, keeping explicit executable and system browser precedence and the default cache fallback. Co-authored-by: Ayaan Zaidi <[email protected]>
What Problem This Solves
Fixes: Linux browser startup cannot find Chromium installed using relative Playwright cache paths, npm configuration aliases, or a hermetic
PLAYWRIGHT_BROWSERS_PATH=0install.User Impact
Existing Playwright installations can be discovered without setting an explicit browser executable path. System/custom executable precedence and default-cache fallback are preserved. No new dependency, configuration option, or migration is introduced.
Why This Change Was Made
Related: #163510. Extend the existing Linux cache locator to match the installed Playwright 1.63.0 locator contract: undefined-only environment aliases, the installer invocation directory for relative paths, exact path bytes, and package-local hermetic caches. Resolve package metadata only for the hermetic case, without importing the browser runtime.
Evidence
da9cb6dfaa748c125e49f736e51300d0ea57caab. Focused RED: 22 passed and 11 intended cache-locator assertions failed; zero suite, hook, or unhandled errors. The existing matrix now includes aliases, precedence, empty values, relative paths, path whitespace, and hermetic installs.pnpm openclaw, verifies the executable/PID and CDP document readback, and stops cleanly. RelativeINIT_CWD,npm_config_playwright_browsers_path, and hermetic0cases each fail only with the expected unsupported-browser discovery error. Task-owned Gateway identity and cleanup checks pass for all four cases.aab42d5998a47ff02dfddba4919408d0c5449bd1: 33/33 matrix tests pass (cold wall/test time 4.62s/0.237s). All four real installer/CLI cases launch the expected executable, verify its PID and CDP document readback, and stop cleanly. Formatting,git diff --check, and canonicalcheck-changedgates pass, including extension/test types, lint, and ownership guards. This individual job succeeded; the aggregate run contains an older NFC formatting failure superseded by that candidate's separate final-head run.ea00cb30c6611dafb186a959cb90ff5bf83d2b5f: maintainer #165177 deleted four redundant browser-cache matrix cases and a redundant macOS fallback case. Rebasing kept those deletions while retaining this PR's new Playwright locator regressions. Current headf78ffaac109cfccedfdd41a5d5776d351ed35703has byte-identical production and docs blobs to the prior tested head; only the test table lost redundant baseline cases. The first rebase headed27ca686d1b7b95754317be499616e83d2e81bafailed upstream formatting checks because its conflict resolution shifted test indentation; that indentation is restored in the current head.git diff --checkpasses, and the complete three-file current-head P0–P3 autoreview is scoped-clean with no findings (confidence 0.90). The local Windows Node is 24.13.1 and lacks Playwright dependencies, so no local test result is claimed; current-head upstream CI is the remaining check.Maintainer verification
No overlap with Pash/Sarah changes.
Preserved ly85206559's implementation and commits; no additional source changes were needed. Current-main changes to this module affect a disjoint desktop-browser detection hunk, and the merge-tree is clean.
f462f36d6afd62018af80ad24245fd20ed4af256fails the relative-install-root, npm-config-alias and hermetic-zero scenarios with the expected unsupported-browser discovery error. Exact candidatef78ffaac109cfccedfdd41a5d5776d351ed35703starts actual Chromium in all three scenarios throughpnpm openclaw, returns the expected tab frombrowser tabs, verifies the executable/PID and CDP document, and stops cleanly. Both relative and hermetic Chromium were installed with Playwright itself./usr/bin/chromiumsymlink to the installed real Chromium in the isolated container. The first candidate control readback encountered a harness-only page-context startup race; the remaining controls were exercised after making the CDP readiness wait tolerate that transient state.pnpm tsgo:extensionspasses. Both source snapshots built successfully; all execution was inside isolated Docker with Gateway state on tmpfs.openai/gpt-5-miniagent turn, low reasoning, 4096-token output budget, successful expected response. Temporary credential removed.ready. The single cancelledPR context and evidencecheck was superseded by the successful same-head check; no selected test job was cancelled.