Skip to content

fix: preserve launch arguments alongside legacy switches - #5630

Merged
Xrazik1 merged 1 commit into
mainfrom
fix/preserve-mixed-launch-arguments
Oct 21, 2026
Merged

Xrazik1 merged 1 commit into
mainfrom
fix/preserve-mixed-launch-arguments

Conversation

@artiom

@artiom artiom commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Preserve explicit launch.args when a request also supplies legacy query-string CLI switches. Existing launch arguments take precedence for matching switch names; non-conflicting legacy switches are appended. Malformed argument values remain available for downstream validation.

Validation

  • TypeScript build passed.
  • Request-shimming suite: 31 passing.
  • JSON and base64 regression cases cover preservation, precedence, embedded equals signs, removal of legacy query parameters, and idempotence.
  • Additional local probes cover absent, empty, and malformed argument values.

The GitHub browser matrix passed for Chrome, Chromium, Edge, Firefox, WebKit, and the multi-browser image. Lint, formatting, leak checks, and CodeQL passed. The Dependabot-only automerge job was skipped.

Summary by CodeRabbit

  • Bug Fixes

    • Preserved explicitly provided launch arguments when processing legacy CLI switches.
    • Prevented duplicate switches from being added when an equivalent argument already exists.
    • Kept malformed launch argument values unchanged for downstream validation.
    • Maintained conversion of legacy switches into name=value format.
  • Tests

    • Added coverage for JSON and base64-encoded launch parameters.
    • Verified legacy switch removal, argument preservation, and idempotent processing.

Devin Review

@coderabbitai

coderabbitai Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Team
  • Run ID: 9f461bf6-d2da-4e73-baf3-476e96d89471
📥 Commits

Reviewing files that changed from the base of the PR and between 007be3f and ea56ece.

📒 Files selected for processing: 2
  • src/shim.spec.ts
  • src/shim.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Walkthrough

The shim now preserves explicit launch.args while adding legacy CLI switches that do not have matching argument names. Tests cover JSON and base64 launch parameters, removal of processed switches, and repeated URL normalization.

Changes

Launch argument handling

Layer / File(s) Summary
Merge launch arguments and validate normalization
src/shim.ts, src/shim.spec.ts
The shim preserves valid explicit arguments, adds legacy switches without matching names, and leaves non-array args values unchanged. Tests cover JSON and base64 launch parameters, removal of processed switches, and repeated shimming.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: joelgriffith

Merge Risk: ⚪ Minimal · up to ea56e

The launch-argument change is ready to merge after normal checks.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: preserving explicit launch arguments alongside legacy switches.
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

A rabbit checks the launch args with care,
Keeps the explicit switches there.
Adds legacy flags when names are new,
And tests both encodings through and through.
The URL stays steady, hop by hop.

Comment @coderabbitai help to get the list of available commands.

artiom commented Oct 21, 2026

Copy link
Copy Markdown
Contributor Author

Current-head validation is complete: all six browser-image test jobs passed, along with lint, formatting, leak checks, and CodeQL. The Dependabot-only automerge job was skipped. CodeRabbit reported no actionable comments; there are no unresolved review threads or merge conflicts. Human review is still required.

@artiom
artiom marked this pull request as ready for review October 21, 2026 10:05

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@Xrazik1
Xrazik1 merged commit eff44d1 into main Oct 21, 2026
18 checks passed
@Xrazik1
Xrazik1 deleted the fix/preserve-mixed-launch-arguments branch October 21, 2026 11:28
artiom pushed a commit that referenced this pull request Oct 21, 2026
🤖 I have created a release *beep* *boop*
---


##
[2.57.2](v2.57.1...v2.57.2)
(2026-10-21)


### Bug Fixes

* make CDP browser shutdown reentrant
([#5626](#5626))
([19841b6](19841b6))
* preserve launch arguments alongside legacy switches
([#5630](#5630))
([eff44d1](eff44d1))


### Build System & Runtime

* bump Node to 24.22.1
([#5631](#5631))
([d2e948c](d2e948c))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: browserless-actions-bot[bot] <186328842+browserless-actions-bot[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.

3 participants