Repository navigation
fix: pass credentials from --proxy-server as proxy username/password - #264
Conversation
Port of upstream microsoft/playwright#43071 (7ad3fba). A proxy URL such as "http://user:pass@myproxy:3128" passed via --proxy-server or PLAYWRIGHT_MCP_PROXY_SERVER is now split into server/username/password, so browsers answer 407 Proxy Authentication challenges instead of ignoring the embedded credentials. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018WmuRF1oEPjUCA7RC1YPci
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 20 minutes. View limit detailsLimit details: You’ve used the included review currently available. Review configuration: ⚙️ Run configuration
📒 Files selected for processing (3)
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (4)
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughProxy server values from CLI and environment options now separate URL credentials into proxy username and password fields. Option descriptions now explain credential handling and show an authenticated proxy URL. ChangesProxy credential parsing
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix · Severity of issue fixed: Medium Suggested reviewers: Merge Risk: ⚪ Minimal · up to No actionable issue remains from the supplied evidence. The proxy credential change is mergeable after normal checks. Architecture SummaryArchitecture risk: 🔵 Low · up to The change affects 3 systems. Changed systems: Architecture concerns Review detailsSystems and components
Before / after behavior
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 3 files. (1 skipped: 1 unsupported.) ✨ Finishing Touches 💡 2📝 Generate docstrings 💡
🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
CI note: the failing browser-regression jobs aren't caused by this PR. The remaining Windows failures come from runner browser updates, and
Root cause: the Windows runners auto-updated their browsers to Chrome 154.0.8037.98 and Edge 154.0.4258.53. The test logs Proposed patch (test-only, kept out of this PR because the list deliberately requires evidence for each version and that decision is the maintainer's): 'win32/chrome/154.0.8037.93',
+ 'win32/chrome/154.0.8037.98',
'win32/msedge/153.0.4234.48',
'win32/msedge/154.0.4258.37',
+ 'win32/msedge/154.0.4258.53',
]);The evidence comes from runs 37259565237 (Chrome job 111603732206; Edge jobs 111603732220 and 111610170341). I won't push it here unless asked. Without it, these two jobs will stay red on every PR until the list is updated. Generated by Claude Code |
decodeURIComponent throws on a '%' that does not start an escape, which dropped the credentials back into the server URL. Decode each credential separately and keep it as typed when it is not a valid escape. Document the proxy option and its credential handling in the README. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018WmuRF1oEPjUCA7RC1YPci
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 327039cf43
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f99ec7f48a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Decoding the whole credential at once failed on any stray '%', which left valid escapes such as %40 encoded too. Decode each run of %XX escapes on its own instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018WmuRF1oEPjUCA7RC1YPci
Upstream change
fix(mcp): pass credentials from --proxy-server as proxy username/password, which fixes microsoft/playwright#43048. Upstream addedproxySettingsFromString(). It splitshttp://user:pass@host:portinto{ server, username, password }, and the MCP config and--proxy-serverhelp text now use it.Why it matters here
src/config.tspassed the--proxy-server/PLAYWRIGHT_MCP_PROXY_SERVERstring tolaunchOptions.proxy.serverunchanged. Browsers ignore credentials embedded in the proxy server URL. Users behind an authenticating proxy therefore got407 Proxy Authentication Requiredon every navigation and scan, even though the flag accepted the credentials without error.Change
src/config.ts: added a localproxySettingsFromString()that mirrors upstream. It defaults a missing scheme to http, percent-decodes the username and password, and falls back to{ server }when the URL has no credentials or does not parse.--proxy-bypassis still applied on top. Proxies set in the config file are unchanged, because they already take explicitusername/passwordfields. The client-certificate path copies the launch proxy into the context, so it now carries the credentials too.src/program.ts,SKILL.md: the help text and docs now give the credentialed form as an example.tests/config.test.ts: added cases for a credentialed URL with a percent-encoded password, a schemeless URL, socks5 with only a username, URLs without credentials (unchanged), and the env var path.Validation
npm run lint(oxlint + typecheck) andnpm run knipare clean.vitest run tests/config.test.tspasses (111 tests).Executable doesn't exist at /opt/pw-browsers/chromium_headless_shell-1243/...). None of them are in config tests.Other upstream MCP changes reviewed this run (no action taken)
browser_findmaxResults, #42968browser_findfile save and #43011browser_wait_forcombining time/text/textGone: these are already here (feat: save browser_find results as optional artifacts #263, fix(wait): race text and textGone and use time as their timeout in browser_wait_for #261).src/mcp/http.tsalready always allowslocalhost,127.0.0.1and::1.page.webmcpAPI: not released yet (stable is still 1.63.0), and this repo doesn't consume it.🤖 Generated with Claude Code
https://claude.ai/code/session_018WmuRF1oEPjUCA7RC1YPci
Generated by Claude Code
Summary by CodeRabbit
The PR should not merge until proxy passwords containing a literal percent sign work and the required README documentation is added.
Findings
Fix with agent prompt
Summary
The PR extracts proxy credentials from CLI and environment proxy URLs into Playwright’s explicit proxy fields and updates help text and configuration tests.
%in a password still defeats credential extraction.Reviews (1) · Last reviewed commit: "fix: pass credentials from --proxy-serve..."