fix(cli): accept trailing browser --window option - #1963
Merged
Conversation
This was referenced Jun 16, 2026
Hoist user-facing browser --window placements after a leaf command into the browser namespace option slot before Commander parses argv. This keeps --window as a namespace option instead of mirroring it onto every browser leaf, while accepting the natural command shape agents tend to produce.\n\nAlso document the trailing form in browser help and cover nested browser groups plus literal -- separators.\n\nCo-authored-by: Zhongyue Lin <zhongyuelin990405@gmail.com>\nCo-authored-by: Chen17-sq <109075336+Chen17-sq@users.noreply.github.com>
jackwener
force-pushed
the
fix/browser-window-trailing-option-integrated
branch
from
June 17, 2026 14:25
882ca86 to
3113483
Compare
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.
What
Fixes #1850 by accepting the natural browser command shape:
--windowremains a browser namespace option. Instead of registering it on every browser leaf command, the existingrewriteBrowserArgvpreprocessor now hoists a trailing--window <mode>/--window=<mode>into the namespace-option slot before Commander parses argv.The branch also includes a lockfile-only production dependency refresh for
wsandjs-yamlbecause the required CI audit gate flagged the old locked versions.package.jsonranges already allow the patched versions, so no range change is needed.Why this version
This integrates the useful parts of both open PRs:
--windowplaced after the subcommand (#1850) #1926 had the lower-blast fix: keep the command tree unchanged and rewrite the user-facing argv shape in the browser preprocessor.browser closeas a skipped session command even thoughbrowser closeroutes throughbrowserAction.This PR uses the preprocessor approach, adds nested-command coverage from the broader concern, avoids rewriting anything after a literal
--, avoids hoisting a bare--windowwithout a value, and documents the trailing placement in browser help examples.Tests
npx vitest run src/cli-argv-preprocess.test.tsnpm run typechecknpm run buildHOME=$(mktemp -d) npx vitest run src/cli-argv-preprocess.test.ts src/cli.test.tsnpm audit --omit=dev --audit-level=highHOME=$(mktemp -d) npm testSupersedes #1926 and #1899.
Fixes #1850.