Skip to content

chore: wire CDP Fetch runtime when proxy is disabled#34276

Open
cacieprins wants to merge 7 commits into
developfrom
cacie/34271/cdp-runtime-when-proxy-disabled
Open

chore: wire CDP Fetch runtime when proxy is disabled#34276
cacieprins wants to merge 7 commits into
developfrom
cacie/34271/cdp-runtime-when-proxy-disabled

Conversation

@cacieprins

Copy link
Copy Markdown
Collaborator

Additional details

Wires the CDP Fetch network runtime when the MITM proxy is disabled (CYPRESS_INTERNAL_DISABLE_PROXY), so AUT request/response traffic is surfaced through CDP Fetch instead of the Node proxy.

  • Adds ServerBase.createCdpFetchNetworkRuntime and hooks it from Chrome/Electron via onPageCriClientReady when the proxy is disabled
  • Slims createCdpFetchRuntime to a lightweight HttpIntercept + CdpFetchTransport path (no legacy NetworkProxy pipeline)
  • Skips proxy-detection / non-proxied clientRoute guards when the proxy is disabled, since path-only hits to the Cypress server are expected under CDP Fetch
  • Passes isAUTFrame into the CDP Fetch transport for AUT-frame correlation

Depends on the CDP Fetch transport from #34222.

Steps to test

  1. Run with proxy disabled (CYPRESS_INTERNAL_DISABLE_PROXY=1) against a Chromium browser.
  2. Confirm AUT traffic is paused/continued via CDP Fetch and reaches HttpIntercept.
  3. Confirm Cypress client assets still load (no false "launched outside Cypress" / non-proxied clientRoute failures).
  4. Spot-check that proxy-enabled mode is unchanged.

How has the user experience changed?

No change for default (proxy-enabled) runs. Enables the proxy-disabled CDP Fetch path for the HTTP/2 interception migration.

PR Tasks

  • Is there an associated issue with maintainer approval for PR submission?
  • Have tests been added/updated?
  • [na] Has a PR for user-facing changes been opened in cypress-documentation?
  • [na] Have API changes been updated in the type definitions?

Made with Cursor

cacieprins and others added 4 commits July 10, 2026 14:37
Co-authored-by: Cursor <cursoragent@cursor.com>
Merging develop reintroduced CreateProxyRuntimeDeps on createCdpFetchRuntime, which broke the proxy-disabled call site that only passes client/isAUTFrame.

Co-authored-by: Cursor <cursoragent@cursor.com>
Comment thread packages/server/lib/browsers/cdp-protocol/cdp-fetch-transport.ts Outdated
Comment thread packages/server/lib/server-base.ts
Reset clears in-flight state without disabling Fetch, and continueRequest
headers always include X-Cypress-Is-AUT-Frame when the request is AUT-frame.

Co-authored-by: Cursor <cursoragent@cursor.com>
@cypress

cypress Bot commented Jul 10, 2026

Copy link
Copy Markdown

cypress    Run #72323

Run Properties:  status check passed Passed #72323  •  git commit c381482cc9: fix: keep CDP Fetch alive across tests and preserve AUT frame header
Project cypress
Branch Review cacie/34271/cdp-runtime-when-proxy-disabled
Run status status check passed Passed #72323
Run duration 09m 27s
Commit git commit c381482cc9: fix: keep CDP Fetch alive across tests and preserve AUT frame header
Committer Cacie Prins
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 2
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 32
View all changes introduced in this branch ↗︎

Warning

No Report: Something went wrong and we could not generate a report for the Application Quality products.

Keep the lightweight CDP Fetch runtime while adopting internal route
serving and loopback header handling from develop.

Co-authored-by: Cursor <cursoragent@cursor.com>

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit f82a6c7. Configure here.

// browser was launched outside Cypress.
if (isProxyDisabled()) {
return next()
}

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.

Proxy off skips cy-in-cy fix

Low Severity

When CYPRESS_INTERNAL_DISABLE_PROXY is set, _forceProxyMiddleware returns next() before any later logic. The CYPRESS_INTERNAL_E2E_TESTING_SELF branch that rewrites path-only proxiedUrl values from the referer never runs, so cy-in-cy self tests with the proxy disabled can keep incorrect URLs.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit f82a6c7. Configure here.

…ions

Cfg.clientRoute is optional because RuntimeConfigOptions extends
Partial<RuntimeServerConfigOptions>. Reuse InternalRouteConfig for CDP
Fetch runtime deps so server-base can pass _openConfig without TS2322.

Co-authored-by: Cursor <cursoragent@cursor.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.

CDP transport for HttpIntercept

1 participant