Skip to content

fix(cli): preserve commas inside Chrome flag values when parsing --args#1289

Open
jin-2-kakaoent wants to merge 1 commit into
vercel-labs:mainfrom
hyunjinee:fix/args-comma-splitting
Open

fix(cli): preserve commas inside Chrome flag values when parsing --args#1289
jin-2-kakaoent wants to merge 1 commit into
vercel-labs:mainfrom
hyunjinee:fix/args-comma-splitting

Conversation

@jin-2-kakaoent
Copy link
Copy Markdown
Contributor

Summary

--args was splitting on every comma, breaking Chrome flags whose values contain comma-separated lists.

Example that failed before this fix:

agent-browser --args "--disable-features=HttpsUpgrades,HttpsFirstModeV2,HttpsFirstModeV2ForEngagedSites" open example.com

The parser turned this into three broken arguments:

["--disable-features=HttpsUpgrades", "HttpsFirstModeV2", "HttpsFirstModeV2ForEngagedSites"]

Chrome's --disable-features, --enable-features, and similar list-valued flags all hit this bug.

Root cause

cli/src/main.rs used .split(&[',', '\n'][..]) — splitting on every comma unconditionally.

Fix

Extract parse_browser_args() which:

  • Always splits on \n
  • Only splits on , when the next non-space character is - (i.e., starts a new flag)
  • Preserves commas inside flag values

Existing usage like --args "--no-sandbox,--disable-gpu" continues to work unchanged.

Test plan

  • --no-sandbox,--disable-gpu["--no-sandbox", "--disable-gpu"] (existing behavior)
  • --disable-features=A,B,C["--disable-features=A,B,C"] (core bug fix)
  • --disable-features=A,B,C, --no-sandbox["--disable-features=A,B,C", "--no-sandbox"] (mixed)
  • --no-sandbox\n--disable-gpu → newline separation still works
  • --disable-features=A,B\n--enable-features=C,D → multiple value-comma flags, newline separated

Fixes #1284

--args was splitting on every comma, breaking Chrome flags whose values
contain comma-separated lists such as:

  --disable-features=HttpsUpgrades,HttpsFirstModeV2,HttpsFirstModeV2ForEngagedSites

The original parser used .split(&[',', '\n'][..]) which turned the flag
above into three broken arguments. Chrome's --disable-features,
--enable-features, and similar list-valued flags are common triggers.

The fix extracts parse_browser_args() which splits on newlines
unconditionally and on commas only when the next non-space character
is '-', preserving all existing comma-separated flag usage.

Fixes vercel-labs#1284
@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Apr 23, 2026

@hyunjinee 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.

--args incorrectly splits single Chrome flags whose values contain commas

2 participants