fix(cli): preserve commas inside Chrome flag values when parsing --args#1289
Open
jin-2-kakaoent wants to merge 1 commit into
Open
fix(cli): preserve commas inside Chrome flag values when parsing --args#1289jin-2-kakaoent wants to merge 1 commit into
jin-2-kakaoent wants to merge 1 commit into
Conversation
--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
Contributor
|
@hyunjinee is attempting to deploy a commit to the Vercel Labs Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--argswas 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.comThe parser turned this into three broken arguments:
Chrome's
--disable-features,--enable-features, and similar list-valued flags all hit this bug.Root cause
cli/src/main.rsused.split(&[',', '\n'][..])— splitting on every comma unconditionally.Fix
Extract
parse_browser_args()which:\n,when the next non-space character is-(i.e., starts a new flag)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 separatedFixes #1284