Skip to content

Make remote dev exchange_url optional#12771

Merged
edmundhung merged 18 commits intomainfrom
penalosa/optional-remote-exchange
Mar 10, 2026
Merged

Make remote dev exchange_url optional#12771
edmundhung merged 18 commits intomainfrom
penalosa/optional-remote-exchange

Conversation

@penalosa
Copy link
Copy Markdown
Contributor

@penalosa penalosa commented Mar 5, 2026

Depending on the zone settings, a fetch to exchange_url can sometimes fail. This PR makes that fetch optional, falling back to the raw token provided by the control plane. Additionally, it removes the experimental tail logs flag, which is now always on.


  • Tests
    • Tests included/updated
    • Automated tests not possible - manual testing has been completed as follows:
    • Additional testing not necessary because: existing tests should pass
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: internal refactor

A picture of a cute animal (not mandatory, but encouraged)


Open with Devin

@penalosa penalosa requested review from a team as code owners March 5, 2026 14:32
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 5, 2026

🦋 Changeset detected

Latest commit: f696f57

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@workers-devprod
Copy link
Copy Markdown
Contributor

workers-devprod commented Mar 5, 2026

Codeowners approval required for this PR:

  • ✅ @cloudflare/wrangler
Show detailed file reviewers

devin-ai-integration[bot]

This comment was marked as resolved.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Mar 5, 2026

create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@12771

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@12771

miniflare

npm i https://pkg.pr.new/miniflare@12771

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@12771

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@12771

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@12771

@cloudflare/vitest-pool-workers

npm i https://pkg.pr.new/@cloudflare/vitest-pool-workers@12771

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@12771

wrangler

npm i https://pkg.pr.new/wrangler@12771

commit: 5254ff9

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 5, 2026

✅ All changesets look good

Copy link
Copy Markdown
Contributor

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

Choose a reason for hiding this comment

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

Devin Review found 1 potential issue.

🐛 1 issue in files not directly in the diff

🐛 Incomplete tailLogs removal enables inspector proxy in remote mode without an inspector URL (packages/wrangler/src/api/startDevWorker/ProxyController.ts:414-418)

The PR removed the --experimental-tail-logs CLI flag (which had default: true), and stopped setting input.experimental.tailLogs in start-dev.ts. However, the check at ProxyController.ts:417 still gates inspector behavior on !this.latestConfig?.experimental?.tailLogs. Since tailLogs is now always false (because ConfigController.ts:375 computes !!input.experimental?.tailLogs from the now-absent input), the inspectorEnabled getter returns true for remote mode — the opposite of the previous default behavior.

Before this PR: tailLogs defaulted to true!true = false → inspector disabled in remote mode.
After this PR: tailLogs is always false!false = true → inspector enabled in remote mode.

But the PR also removed userWorkerInspectorUrl from the proxyData emitted by RemoteRuntimeController (RemoteRuntimeController.ts:307). So the InspectorProxyWorker is now started (ProxyController.ts:139) and receives reloadComplete messages (ProxyController.ts:457-461) with no inspector URL to connect to, which is a regression from the previous default behavior.

View 6 additional findings in Devin Review.

Open in Devin Review

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

penalosa added 8 commits March 9, 2026 10:49
…workers

- Fix test mocks to match new CfPreviewSession/CfPreviewToken shapes
- playground-preview-worker: make exchange_url optional, use initial
  token as fallback, remove inspector URL construction and prewarm
- playground frontend: remove inspector from response codec
- edge-preview-authenticated-proxy: remove /exchange CORS proxy
  endpoint (dead since DEVX-979), remove prewarm from
  .update-preview-token flow
@penalosa penalosa force-pushed the penalosa/optional-remote-exchange branch from c2f5da8 to dbe6908 Compare March 9, 2026 14:53
devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

Copy link
Copy Markdown
Member

@NuroDev NuroDev left a comment

Choose a reason for hiding this comment

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

Blocking: Remove a placeholder console.log. Didn't realise console.log was part of a fixture. Not blocking.

The rest is just a few tiny cleanup bits. The rest LGTM.

Comment thread fixtures/worker-ts/src/index.ts Outdated
Comment thread packages/edge-preview-authenticated-proxy/src/index.ts Outdated
Comment thread packages/wrangler/src/dev/create-worker-preview.ts Outdated
@github-project-automation github-project-automation bot moved this from Untriaged to In Review in workers-sdk Mar 9, 2026
@github-project-automation github-project-automation bot moved this from In Review to Approved in workers-sdk Mar 10, 2026
Comment thread packages/playground-preview-worker/src/realish.ts Outdated
Comment thread packages/playground-preview-worker/src/realish.ts Outdated
Comment thread packages/wrangler/src/dev/create-worker-preview.ts
Comment thread packages/wrangler/src/dev/create-worker-preview.ts Outdated
Comment thread packages/wrangler/src/dev/create-worker-preview.ts Outdated
Copy link
Copy Markdown
Contributor

@petebacondarwin petebacondarwin left a comment

Choose a reason for hiding this comment

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

LGTM with a few nits.

@workers-devprod
Copy link
Copy Markdown
Contributor

Codeowners approval required for this PR:

  • ✅ @cloudflare/wrangler
Show detailed file reviewers

@edmundhung edmundhung merged commit b8c33f5 into main Mar 10, 2026
43 of 47 checks passed
@edmundhung edmundhung deleted the penalosa/optional-remote-exchange branch March 10, 2026 19:07
@github-project-automation github-project-automation bot moved this from Approved to Done in workers-sdk Mar 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants