Conversation
Adds a new playwright-chromium pkg that pins Playwright browser revision 1200 (Chrome 143.0.7499.4 / playwright-core ^1.57.0) with per-arch sources — amd64 fetches via Playwright's CDN (which redirects to Google Chrome for Testing), arm64 fetches Microsoft-hosted Playwright builds. Lays out files at /usr/share/playwright-chromium/chromium-1200/ in the layout @playwright/test expects (chrome-linux64/ on amd64, chrome-linux/ on arm64), plus a /usr/bin/playwright-chromium wrapper. agent-browser drops `npx playwright-core install chromium` from its build and instead depends on playwright-chromium; the wrapper passes --executable-path /usr/bin/playwright-chromium to the daemon. Removes the previously-inlined chromium system-lib runtime_dep list since they now come transitively via playwright-chromium. Picked playwright-chromium over chrome-for-testing because Google does not yet publish a linux-arm64 CfT build (announced for Q2 2026 but the publishing pipeline hasn't shipped arm64 zips). Playwright self-hosts arm64 chromium, so it's the only pinnable source that works on both arches today. Notion follow-up tracks creating chrome-for-testing and flipping back once Google ships arm64 CfT. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
✅ Files skipped from review due to trivial changes (2)
📝 WalkthroughWalkthroughThis PR extracts Chromium into a new ChangesPlaywright Chromium Packaging and Agent-Browser Integration
sequenceDiagram
autonumber
participant User
participant Wrapper as /usr/bin/agent-browser (wrapper)
participant Daemon as agent-browser daemon
participant Chromium as /usr/bin/playwright-chromium
User->>Wrapper: run agent-browser $ARGS
Wrapper->>Daemon: exec daemon --executable-path /usr/bin/playwright-chromium $ARGS
Daemon->>Chromium: launch executable at /usr/bin/playwright-chromium with Playwright args
Chromium-->>Daemon: spawn browser process / respond
Daemon-->>User: forward output / provide browser-driven responses
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/playwright-chromium/build.ncl`:
- Around line 122-126: The attrs block currently sets upstream_version but omits
source_provenance; update the attrs map (the attrs symbol in build.ncl) to add a
source_provenance entry documenting the canonical upstream source and version
(use the same browser_version value already assigned to upstream_version), so
packaging metadata is complete—leave build_cost_multiple as-is and ensure the
provenance points to the canonical upstream URL/source for this browser.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: ed0c4445-8707-413e-bd8b-ec6abe6cc7de
📒 Files selected for processing (4)
packages/agent-browser/build.nclpackages/agent-browser/build.shpackages/playwright-chromium/build.nclpackages/playwright-chromium/build.sh
Spins up a throwaway npm project, installs playwright-core@1.57.0 (matches our pinned browser revision 1200), sets PLAYWRIGHT_BROWSERS_PATH to the playwright-chromium pkg, and tries to launch chromium. If the on-disk layout is correct, launch() returns the chromium version. Lets the integration be tested before this PR merges (so consumers don't have to wait for `minimal update` in their downstream repo). Tagged temp-* so it's clear this should be removed before merge. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@minimal.toml`:
- Line 31: The temporary directory created by mktemp -d is never removed and the
unquoted cd $T can break on paths with spaces; modify the shell command that
creates T to set a trap to remove the directory on EXIT (e.g., trap 'rm -rf
"$T"' EXIT) and quote uses of the variable (change cd $T to cd "$T" and quote
any other occurrences of $T) so the temp-dir is cleaned up reliably and path
values are safe.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
Playwright treats `chromium` and `chromium-headless-shell` as two
separate browser installs (see playwright-core/browsers.json). Default
chromium.launch() runs headless, which uses the headless-shell binary
at chromium_headless_shell-<rev>/<inner>/{headless_shell,chrome-headless-shell}
— without it, launch() fails with "Executable doesn't exist at ...".
Adds a second per-arch Source for the headless-shell zip and extracts
each zip into a scratch dir before installing (both arm64 zips happen
to use the same chrome-linux/ top-level name, so they'd clobber one
another otherwise). Bumps build_cost_multiple from 2 to 3 since the
shell zip nearly doubles the artifact size.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Integration verified on arm64: chromium.launch() resolves executablePath to the pkg's chrome-linux/chrome, launches the headless-shell binary, and returns version 143.0.7499.4 without any download attempt. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 1
♻️ Duplicate comments (1)
packages/playwright-chromium/build.ncl (1)
146-150:⚠️ Potential issue | 🟠 Major | ⚡ Quick winAdd missing
source_provenancemetadata inattrs.
upstream_versionis present, butsource_provenanceis still missing. This leaves required package provenance incomplete.Suggested fix
attrs = { upstream_version = browser_version, + source_provenance = { + category = 'GithubRepo, + owner = "microsoft", + repo = "playwright", + }, build_cost_multiple = 3, } | Attrs,As per coding guidelines, “Set source_provenance for GitHub projects using
category = 'GithubRepo, owner = "<account>", repo = "<repo>"… and use canonical upstream sources.”🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/playwright-chromium/build.ncl` around lines 146 - 150, The attrs block currently sets upstream_version but omits required source_provenance; update the attrs object (the Attrs being merged) to include a source_provenance field for the GitHub upstream—e.g., add source_provenance = { category = "GithubRepo", owner = "<owner>", repo = "<repo>" } (replace <owner> and <repo> with the canonical repository) and ensure any canonical upstream source fields are set accordingly so provenance is complete alongside upstream_version in the same attrs record.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/playwright-chromium/build.sh`:
- Around line 20-21: The assignment to FULL_INNER and SHELL_INNER using `ls
_full` and `ls _shell` can return multiple entries and corrupt subsequent `cp`
targets/wrapper paths; update the logic that sets FULL_INNER and SHELL_INNER to
explicitly enumerate entries in the `_full` and `_shell` extraction roots,
verify there is exactly one top-level entry in each directory (fail with a clear
error if count != 1), and then assign the variable to that single entry name so
downstream `cp`/wrapper path logic uses an unambiguous directory; look for the
symbols FULL_INNER and SHELL_INNER in the script and replace the `ls` usage with
this validation-and-assign pattern.
---
Duplicate comments:
In `@packages/playwright-chromium/build.ncl`:
- Around line 146-150: The attrs block currently sets upstream_version but omits
required source_provenance; update the attrs object (the Attrs being merged) to
include a source_provenance field for the GitHub upstream—e.g., add
source_provenance = { category = "GithubRepo", owner = "<owner>", repo =
"<repo>" } (replace <owner> and <repo> with the canonical repository) and ensure
any canonical upstream source fields are set accordingly so provenance is
complete alongside upstream_version in the same attrs record.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: f6e0e4b2-f278-4cf6-98e8-f8de6342ce40
📒 Files selected for processing (2)
packages/playwright-chromium/build.nclpackages/playwright-chromium/build.sh
Add source_provenance attrs and harden the inner-dir detection in build.sh against zips that ever produce more than one top-level entry. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Summary
playwright-chromiumpkg with per-arch sources (amd64 via Playwright→CfT redirect, arm64 via Playwright's MS-hosted build), pinned to browser revision 1200 (Chrome 143.0.7499.4, matchesplaywright-core ^1.57.0).chromium-headless-shell, since@playwright/testtreats them as separate browser installs (defaultchromium.launch()runs headless via the shell binary)./usr/share/playwright-chromium/chromium-1200/and/usr/share/playwright-chromium/chromium_headless_shell-1200/in the layout@playwright/testexpects (per-arch dir names:chrome-linux64/on amd64,chrome-linux/on arm64), plus a/usr/bin/playwright-chromiumwrapper.agent-browserdropsnpx playwright-core install chromiumand instead depends onplaywright-chromium; the wrapper passes--executable-path /usr/bin/playwright-chromium.runtime_deplist fromagent-browsersince they come transitively viaplaywright-chromium.Drop-in replacement for
npx playwright install chromiumFor Playwright users, the new pkg replaces the runtime CDN install with a real Minimal dependency. Set
PLAYWRIGHT_BROWSERS_PATH=/usr/share/playwright-chromiumin your CI env or task and@playwright/testwill find the pre-installed binary at the layout it expects (chromium-1200/<inner>/chromefor headed,chromium_headless_shell-1200/<inner>/{headless_shell,chrome-headless-shell}for headless) and skip the download. TheINSTALLATION_COMPLETEmarker is written to both browser dirs so Playwright treats it as a successful install rather than re-fetching.This gets us a real supply-chain story versus running
npx playwright installad-hoc:packages/playwright-chromium/build.ncl, version-controlled and reviewable.npx playwright installdoes verify hashes internally, but the expected hashes are buried inside a transitively-pinned npm dep that consumers rarely inspect.node_modules— two builds of the sameplaywright-chromiumpkg version always produce byte-identical chromium binaries, regardless of whatplaywright-coreresolves to in any given project's lockfile.npx playwright installre-runs at every freshnode_modulesinstall and requires sandbox internet access.match { arch = 'Amd64, .. } | { arch = 'Arm64, .. }blocks inbuild.nclmake the cross-platform contract reviewable in one place.Why playwright-chromium and not chrome-for-testing
Upstream agent-browser is built around Chrome for Testing (Google's official automation channel), and that would be the natural pkg to depend on. But as of 2026-05-06 Google does not publish a linux-arm64 CfT build — the JSON manifest has only
linux64,mac-arm64,mac-x64,win32,win64. ARM64 Linux Chrome was announced for Q2 2026 but the CfT publishing pipeline hasn't shipped arm64 zips yet (upstream tracker).Playwright self-hosts a linux-arm64 chromium build (their CDN redirects amd64 → Google's CfT bucket but arm64 →
playwright.download.prss.microsoft.com), soplaywright-chromiumis the only pinnable chromium source today that works on both arches.Notion follow-up tracks creating a
chrome-for-testingpkg and flippingagent-browserback once Google ships arm64 CfT.Test plan
min check --packages playwright-chromium agent-browsercleanmin patched-pkg playwright-chromiumbuilds (linux-arm64)min patched-pkg agent-browserbuilds against the new depplaywright-chromium --version→Chromium 143.0.7499.4;agent-browser --version→agent-browser 0.15.1@playwright/testintegration on arm64:chromium.launch()resolvesexecutablePathto the pkg's chrome binary, launches the headless-shell variant, returns version 143.0.7499.4 without re-downloading (verified via temp task removed in last commit)playwright-chromium(separate PR in webapp repo)🤖 Generated with Claude Code
Summary by CodeRabbit