Skip to content

feat: add Chrome install mirror env vars#871

Open
M4n5ter wants to merge 2 commits intovercel-labs:mainfrom
M4n5ter:m4n5ter/chrome-install-mirror-env-vars
Open

feat: add Chrome install mirror env vars#871
M4n5ter wants to merge 2 commits intovercel-labs:mainfrom
M4n5ter:m4n5ter/chrome-install-mirror-env-vars

Conversation

@M4n5ter
Copy link

@M4n5ter M4n5ter commented Mar 17, 2026

Summary

Add Chrome install mirror support via two explicit environment variables:

  • AGENT_BROWSER_CHROME_LAST_KNOWN_GOOD_URL
  • AGENT_BROWSER_CHROME_DOWNLOAD_BASE_URL

This keeps the Stable version source and archive download base configurable without assuming they come from the same endpoint shape.

It also makes agent-browser install usable in restricted network environments and private mirror deployments where direct access to Google's Chrome for Testing endpoints is blocked or undesirable.

Why two environment variables

The previous implementation depended on last-known-good-versions-with-downloads.json and trusted the embedded per-platform download URLs.

That does not work well for all mirrors:

  • many mirrors only expose last-known-good-versions.json for Stable version resolution
  • some mirrors expose version metadata and archives under a mirrored base URL, but do not provide last-known-good-versions-with-downloads.json
  • for example, npmmirror exposes known-good-versions-with-downloads.json, but that is not a drop-in replacement for Stable resolution and does not provide the exact contract we want here

By splitting the configuration into a Stable manifest URL and a download base URL, install logic can:

  • resolve the Stable version from a simple CfT manifest
  • construct the archive URL from a known {version}/{platform}/{archive} base layout
  • avoid depending on mirrored with-downloads metadata being present or rewritten

Example mirror configuration:

export AGENT_BROWSER_CHROME_LAST_KNOWN_GOOD_URL=https://cdn.npmmirror.com/binaries/chrome-for-testing/last-known-good-versions.json
export AGENT_BROWSER_CHROME_DOWNLOAD_BASE_URL=https://cdn.npmmirror.com/binaries/chrome-for-testing
agent-browser install

Changes

  • replace the install-time last-known-good-versions-with-downloads.json dependency with Stable version resolution from last-known-good-versions.json
  • add explicit parsing and validation for AGENT_BROWSER_CHROME_LAST_KNOWN_GOOD_URL and AGENT_BROWSER_CHROME_DOWNLOAD_BASE_URL
  • build Chrome archive URLs from the configured download base instead of trusting manifest-provided download links
  • tighten install error messages around invalid URLs, invalid version formats, and download failures
  • add unit coverage for default behavior, override behavior, HTTP mirror support, and version validation
  • document the mirror configuration in CLI help, README, docs, and the agent skill guide

@vercel
Copy link
Contributor

vercel bot commented Mar 17, 2026

@M4n5ter is attempting to deploy a commit to the Vercel Labs Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant