[wrangler] Make remote binding sessions lazy only #17209
⚠️ No Changeset found
Latest commit: c5d109171a6a3c81860ec4fbe80726372572a381
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
<details><summary>This PR includes changesets to release 3 packages</summary>
| Name | Type |
| ------------------------- | ----- |
| wrangler | Patch |
| @cloudflare/vite-plugin | Patch |
| @cloudflare/vitest-plugin | Patch |
</details>
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
startRemoteProxySession() and its options type are exported by Wrangler. Removing lazy makes existing TypeScript callers fail to compile, and changing startup/ready/updateBindings() from remote readiness to local-proxy readiness changes the runtime contract for JavaScript callers. Publishing this as a patch would silently break consumers that use the programmatic API.
"wrangler": major
I'm Bonk, and I've done a quick review of your PR.
Makes remote-binding sessions lazy-only and removes eager setup paths.
1. P1 The public Wrangler API change is released as a patch despite breaking TypeScript and runtime contracts. Posted a suggestion comment.
[github run](/cloudflare/workers-sdk/actions/runs/45863138770)
<!-- devin-review-comment {"id": "ANALYSIS_pr-review-job-ec83da85a5bf4df7b6cf96ae5b37be1c_0003", "file_path": "packages/wrangler/e2e/remote-binding/remote-bindings-api.test.ts", "side": "RIGHT", "kind": "analysis"} -->
🔍 First-call test hides preview timeouts
The direct API test now spends timedDispatchFetch’s five-second budget on preview setup as well as dispatch. The helper converts an abort to null, so a slow preview shows up as a response assertion failure.
<!-- devin-review-badge-begin -->
<a href="https://cloudflare.devinenterprise.com/review/cloudflare/workers-sdk/pull/17209" target="_blank"><picture><source media="(prefers-color-scheme: dark)" srcset="https://static.devin.ai/assets/gh-devin-review-dark.svg?v=4"><img src="https://static.devin.ai/assets/gh-devin-review-light.svg?v=4" alt="Devin Review"></picture></a>
<!-- devin-review-badge-end -->
---
Was this helpful? React with 👍 or 👎 to provide feedback.
<!-- devin-review-comment {"id": "ANALYSIS_pr-review-job-ec83da85a5bf4df7b6cf96ae5b37be1c_0001", "file_path": ".changeset/quiet-remote-only-bindings.md", "start_line": 15, "end_line": 15, "side": "RIGHT", "kind": "analysis"} -->
🔍 Patch breaks published readiness guarantees
The Wrangler changelog promises that updateBindings() waits for reload and rejects on failure. Existing callers can report a successful binding update before the remote preview rejects it. The release rules forbid a Wrangler major bump, so keep the existing contract or offer lazy startup separately.
<!-- devin-review-badge-begin -->
<a href="https://cloudflare.devinenterprise.com/review/cloudflare/workers-sdk/pull/17209" target="_blank"><picture><source media="(prefers-color-scheme: dark)" srcset="https://static.devin.ai/assets/gh-devin-review-dark.svg?v=4"><img src="https://static.devin.ai/assets/gh-devin-review-light.svg?v=4" alt="Devin Review"></picture></a>
<!-- devin-review-badge-end -->
---
Was this helpful? React with 👍 or 👎 to provide feedback.
<!-- devin-review-comment {"id": "ANALYSIS_pr-review-job-ec83da85a5bf4df7b6cf96ae5b37be1c_0002", "file_path": "packages/wrangler/src/api/remoteBindings/start-remote-proxy-session.ts", "start_line": 23, "end_line": 23, "side": "RIGHT", "kind": "analysis"} -->
🔍 Idle sessions leave auth promises unhandled
startRemoteProxySession() still accepts an already-running auth promise through AsyncHook. RemoteRuntimeController only awaits it on first use. If the promise rejects while the session is idle, Node can exit before any binding call reports the error.
<!-- devin-review-badge-begin -->
<a href="https://cloudflare.devinenterprise.com/review/cloudflare/workers-sdk/pull/17209" target="_blank"><picture><source media="(prefers-color-scheme: dark)" srcset="https://static.devin.ai/assets/gh-devin-review-dark.svg?v=4"><img src="https://static.devin.ai/assets/gh-devin-review-light.svg?v=4" alt="Devin Review"></picture></a>
<!-- devin-review-badge-end -->
---
Was this helpful? React with 👍 or 👎 to provide feedback.
[!NOTE]
Newer findings are available below. Devin Review posted a newer report on this PR, in addition to the findings presented here.
Devin Review found 3 potential issues.
<!-- devin-review-badge-begin -->
<a href="https://cloudflare.devinenterprise.com/review/cloudflare/workers-sdk/pull/17209" target="_blank"><picture><source media="(prefers-color-scheme: dark)" srcset="https://static.devin.ai/assets/gh-devin-review-dark.svg?v=4"><img src="https://static.devin.ai/assets/gh-devin-review-light.svg?v=4" alt="Devin Review"></picture></a>
<!-- devin-review-badge-end -->
<details><summary><b>@cloudflare/autoconfig</b></summary><p>
npm i https://pkg.pr.new/@cloudflare/autoconfig@17209
</p></details>
<details><summary><b>@cloudflare/build-output-utils</b></summary><p>
npm i https://pkg.pr.new/@cloudflare/build-output-utils@17209
</p></details>
<details><summary><b>@cloudflare/cli-shared-helpers</b></summary><p>
npm i https://pkg.pr.new/@cloudflare/cli-shared-helpers@17209
</p></details>
<details><summary><b>@cloudflare/codemods</b></summary><p>
npm i https://pkg.pr.new/@cloudflare/codemods@17209
</p></details>
<details><summary><b>@cloudflare/config</b></summary><p>
npm i https://pkg.pr.new/@cloudflare/config@17209
</p></details>
<details><summary><b>@cloudflare/containers-shared</b></summary><p>
npm i https://pkg.pr.new/@cloudflare/containers-shared@17209
</p></details>
<details><summary><b>create-cloudflare</b></summary><p>
npm i https://pkg.pr.new/create-cloudflare@17209
</p></details>
<details><summary><b>@cloudflare/deploy-helpers</b></summary><p>
npm i https://pkg.pr.new/@cloudflare/deploy-helpers@17209
</p></details>
<details><summary><b>@cloudflare/kv-asset-handler</b></summary><p>
npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@17209
</p></details>
<details><summary><b>miniflare</b></summary><p>
npm i https://pkg.pr.new/miniflare@17209
</p></details>
<details><summary><b>@cloudflare/pages-functions</b></summary><p>
npm i https://pkg.pr.new/@cloudflare/pages-functions@17209
</p></details>
<details><summary><b>@cloudflare/pages-shared</b></summary><p>
npm i https://pkg.pr.new/@cloudflare/pages-shared@17209
</p></details>
<details><summary><b>@cloudflare/runtime-types</b></summary><p>
npm i https://pkg.pr.new/@cloudflare/runtime-types@17209
</p></details>
<details><summary><b>@cloudflare/test-server</b></summary><p>
npm i https://pkg.pr.new/@cloudflare/test-server@17209
</p></details>
<details><summary><b>@cloudflare/unenv-preset</b></summary><p>
npm i https://pkg.pr.new/@cloudflare/unenv-preset@17209
</p></details>
<details><summary><b>@cloudflare/vite-plugin</b></summary><p>
npm i https://pkg.pr.new/@cloudflare/vite-plugin@17209
</p></details>
<details><summary><b>@cloudflare/vitest-plugin</b></summary><p>
npm i https://pkg.pr.new/@cloudflare/vitest-plugin@17209
</p></details>
<details><summary><b>@cloudflare/workers-auth</b></summary><p>
npm i https://pkg.pr.new/@cloudflare/workers-auth@17209
</p></details>
<details><summary><b>@cloudflare/workers-editor-shared</b></summary><p>
npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@17209
</p></details>
<details><summary><b>@cloudflare/workers-utils</b></summary><p>
npm i https://pkg.pr.new/@cloudflare/workers-utils@17209
</p></details>
<details><summary><b>wrangler</b></summary><p>
npm i https://pkg.pr.new/wrangler@17209
</p></details>
_commit: <a href="https://github.com/cloudflare/workers-sdk/runs/141973651324"><code>c5d1091</code></a>_
Wrangler's programmatic `startRemoteProxySession()` also defers authentication and remote preview setup until the first binding call. Successful startup now signals local proxy readiness only; authentication and preview failures surface on binding calls. `updateBindings()` applies the new proxy configuration without waiting for the remote preview.
The lazy property was never released so no need to mention it here.
The the lazy property was never released, and the behaviour change is an acceptable non-breaking change in our view.
<!-- devin-review-comment {"id": "ANALYSIS_pr-review-job-9d1a48ed26bb4145aaa21264791c7b87_0001", "file_path": ".changeset/quiet-remote-only-bindings.md", "start_line": 15, "end_line": 15, "side": "RIGHT", "kind": "analysis"} -->
🔍 Missing migration for lazy callers
The changeset explains when startRemoteProxySession() connects but leaves out that callers can drop lazy: true without changing connection timing.
<!-- devin-review-badge-begin -->
<a href="https://cloudflare.devinenterprise.com/review/cloudflare/workers-sdk/pull/17209" target="_blank"><picture><source media="(prefers-color-scheme: dark)" srcset="https://static.devin.ai/assets/gh-devin-review-dark.svg?v=4"><img src="https://static.devin.ai/assets/gh-devin-review-light.svg?v=4" alt="Devin Review"></picture></a>
<!-- devin-review-badge-end -->
---
Was this helpful? React with 👍 or 👎 to provide feedback.
[!NOTE]
Newer findings are available below. Devin Review posted a newer report on this PR, in addition to the findings presented here.
Devin Review found 1 new potential issue.
<!-- devin-review-badge-begin -->
<a href="https://cloudflare.devinenterprise.com/review/cloudflare/workers-sdk/pull/17209" target="_blank"><picture><source media="(prefers-color-scheme: dark)" srcset="https://static.devin.ai/assets/gh-devin-review-dark.svg?v=4"><img src="https://static.devin.ai/assets/gh-devin-review-light.svg?v=4" alt="Devin Review"></picture></a>
<!-- devin-review-badge-end -->
<!-- devin-review-comment {"id": "ANALYSIS_pr-review-job-829e216545594524b2203c71609bc725_0001", "file_path": "packages/remote-bindings/src/start-remote-proxy-session.ts", "start_line": 94, "end_line": 97, "side": "RIGHT", "kind": "analysis"} -->
🔍 Early evaluation of lazy auth promises
startRemoteProxySession subscribes to auth promises at startup. A custom promise that starts credential lookup in then() no longer waits for a binding call; a callback still does.
<!-- devin-review-badge-begin -->
<a href="https://cloudflare.devinenterprise.com/review/cloudflare/workers-sdk/pull/17209" target="_blank"><picture><source media="(prefers-color-scheme: dark)" srcset="https://static.devin.ai/assets/gh-devin-review-dark.svg?v=4"><img src="https://static.devin.ai/assets/gh-devin-review-light.svg?v=4" alt="Devin Review"></picture></a>
<!-- devin-review-badge-end -->
---
Was this helpful? React with 👍 or 👎 to provide feedback.
[!NOTE]
Newer findings are available below. Devin Review posted a newer report on this PR, in addition to the findings presented here.
Devin Review found 1 new potential issue.
<!-- devin-review-badge-begin -->
<a href="https://cloudflare.devinenterprise.com/review/cloudflare/workers-sdk/pull/17209" target="_blank"><picture><source media="(prefers-color-scheme: dark)" srcset="https://static.devin.ai/assets/gh-devin-review-dark.svg?v=4"><img src="https://static.devin.ai/assets/gh-devin-review-light.svg?v=4" alt="Devin Review"></picture></a>
<!-- devin-review-badge-end -->
Codeowners approval required for this PR:
<details><summary>Show detailed file reviewers</summary>
</details>
<!-- durable-reviewer:finding -->
ℹ️ INFO · Code Quality
Orphaned JSDoc left above server after the lazy field was removed.
This comment documented the lazy? field that this pull request removes. It now sits above server and describes the wrong property. Sessions are always on-demand now, so the line can go.
<!-- durable-reviewer:finding -->
ℹ️ INFO · Code Quality
Changeset migration line refers to an unreleased lazy option and says connection timing is unchanged.
You say lazy was never released, so no published user can be passing lazy: true. The line also says connection timing stays the same, which contradicts line 15 for callers who relied on startup rejecting. Removing the line avoids confusing readers of the changelog.
<!-- durable-reviewer:review run=7bff3642-6a64-4bd9-b49a-af30ae6da6ae -->
Superseded by the review of 3988253c.<details>
<summary>This review, of <code>e7b73d7f</code></summary>
💬 Approved with comments — The lazy-only refactor holds together and no correctness or security defects turned up. What remains is the release-level question for the programmatic API timing change, a misleading changeset line, and an orphaned doc comment.
Findings: 1 question · 2 info (2 are inline comments on the diff)
<sub>The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.</sub>
---
📋 Code Quality: 💬 2 info
The refactor holds together. One orphaned doc comment and one misleading changeset line remain.
Recommendation: 💬 Optional Nits
server after the lazy field was removed. (packages/remote-bindings/src/startDevWorker/types.ts:20)lazy option and says connection timing is unchanged. (.changeset/quiet-remote-only-bindings.md:17)<details>
<summary>View full review</summary>
packages/remote-bindings/src/startDevWorker/types.ts:20: the JSDoc for the removed lazy field now documents server..changeset/quiet-remote-only-bindings.md:17: the migration line is for an option that was never released, and it claims connection timing is unchanged, which is not true for callers who relied on the old behaviour.</details>
---
🚀 Release: ❓ 1 question
Confirm that the patch level is intended for the change to the programmatic API's timing.
Recommendation: 📝 Minor Comments
patch the intended release level, given that programmatic startRemoteProxySession() callers no longer see startup reject on authentication or preview failures? (.changeset/quiet-remote-only-bindings.md:15)<details>
<summary>View full review</summary>
The exported startRemoteProxySession() no longer rejects at startup when authentication or preview setup fails, and updateBindings() no longer waits for the remote preview. You say this is an acceptable non-breaking change and that lazy was never released. The release history was not available to check this here, so please confirm the patch classification deliberately before merging.
</details>
---
<details>
<summary>✅ All other checks passed</summary>
🔒 Security: ✅ LGTM
Nothing in this change widens a trust boundary. Removing the background timers means login can no longer start without a binding request, and a reload always clears the stored preview data, so a stale preview is not reused.
---
📖 AGENTS.md: ✅ LGTM
No AGENTS.md guidance is made inaccurate by the lines this pull request changes.
---
⚡ Performance: ✅ LGTM
No performance concerns.
---
📝 Documentation: ✅ LGTM
Line 15 of the changeset describes the new startRemoteProxySession() timing accurately.
</details>
---
<sub>Reviewed commit: e7b73d7f</sub>
</details>
<!-- durable-reviewer:review run=734519f4-889a-4bac-a76d-a30337db7fa4 -->
Superseded by the review of 974bdf0c.<details>
<summary>This review, of <code>3988253c</code></summary>
✅ Approved — Both earlier notes are fixed and the release-level choice has been answered deliberately in the discussion. No correctness, security or performance issues were found in the lazy-only refactor.
<sub>The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.</sub>
---
<details>
<summary>✅ All checks passed</summary>
🚀 Release: ✅ LGTM
Programmatic startRemoteProxySession() callers now see authentication and preview failures on binding calls rather than at startup. The changeset documents this, and the author has confirmed in the discussion that patch is the intended level.
---
🔒 Security: ✅ LGTM
No trust boundary is widened. Login can no longer start without a binding request, and a stale preview is not reused across reloads.
---
📖 AGENTS.md: ✅ LGTM
No AGENTS.md guidance is made inaccurate by this change.
---
📋 Code Quality: ✅ LGTM
The orphaned JSDoc in startDevWorker/types.ts and the stale migration line in the changeset are both gone. The refactor removes the eager start, reload and timer paths cleanly, and the tests cover the new on-demand behaviour.
---
⚡ Performance: ✅ LGTM
No performance concerns.
---
📝 Documentation: ✅ LGTM
The changeset describes the new startRemoteProxySession() timing accurately.
</details>
---
<sub>Reviewed commit: 3988253c</sub>
</details>
✅ Resolved: The earlier concern about an already-running auth promise is not re-raised by the current finding and was marked resolved in the prior review state.
<!-- devin-review-comment {"id": "ANALYSIS_pr-review-job-b3181bf5230d497fb2d44400b9b47e5b_0001", "file_path": ".changeset/quiet-remote-only-bindings.md", "start_line": 15, "end_line": 15, "side": "RIGHT", "kind": "analysis"} -->
🔍 Missing migration note for lazy option
The changeset explains the new timing but omits that the public session options no longer accept lazy. Callers that pass lazy: true can remove it without changing when their session connects.
<!-- devin-review-badge-begin -->
<a href="https://cloudflare.devinenterprise.com/review/cloudflare/workers-sdk/pull/17209" target="_blank"><picture><source media="(prefers-color-scheme: dark)" srcset="https://static.devin.ai/assets/gh-devin-review-dark.svg?v=4"><img src="https://static.devin.ai/assets/gh-devin-review-light.svg?v=4" alt="Devin Review"></picture></a>
<!-- devin-review-badge-end -->
---
Was this helpful? React with 👍 or 👎 to provide feedback.
[!NOTE]
Newer findings are available below. Devin Review posted a newer report on this PR, in addition to the findings presented here.
Devin Review found 1 new potential issue.
<!-- devin-review-badge-begin -->
<a href="https://cloudflare.devinenterprise.com/review/cloudflare/workers-sdk/pull/17209" target="_blank"><picture><source media="(prefers-color-scheme: dark)" srcset="https://static.devin.ai/assets/gh-devin-review-dark.svg?v=4"><img src="https://static.devin.ai/assets/gh-devin-review-light.svg?v=4" alt="Devin Review"></picture></a>
<!-- devin-review-badge-end -->
<!-- durable-reviewer:review run=8d65a338-2718-4611-b71f-c1a590941200 -->
Superseded by the review of b5384d63.<details>
<summary>This review, of <code>974bdf0c</code></summary>
✅ Approved — The files changed since the previous review keep the lazy-only refactor consistent, and no correctness, security or performance issues were found. The release-level choice is documented in the changeset and was confirmed in the discussion.
<sub>The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.</sub>
---
<details>
<summary>✅ All checks passed</summary>
🚀 Release: ✅ LGTM
Authentication and preview failures now surface on the first binding call rather than at startup. The changeset documents this for Wrangler, the Vite plugin and the Vitest plugin, and the author has confirmed patch as the intended level. The credentialed e2e suite has not been run for this change.
---
🔒 Security: ✅ LGTM
No trust boundary is widened. Login can no longer start without a binding request.
---
📖 AGENTS.md: ✅ LGTM
This change does not make any AGENTS.md guidance inaccurate.
---
📋 Code Quality: ✅ LGTM
The DevEnv.ts, ProxyController.ts and events.ts updates are consistent with connecting on the first binding call. There are no leftover references to lazy, localServerReady or the removed refresh-retry interval in packages/remote-bindings, and the tests cover the on-demand refresh recovery path.
---
⚡ Performance: ✅ LGTM
No performance concerns.
---
📝 Documentation: ✅ LGTM
The changeset accurately describes the new startRemoteProxySession() timing.
</details>
---
<sub>Reviewed commit: 974bdf0c</sub>
</details>
lazy was never released and this is updating the changeset that introduced it.
why these changes? is lazy becomes the only mode, shouldn't this code remain here and be run unconditionally instead of it being removed?
Makes sense to me
Codeowners reviews satisfied
Good question. The old startup path handled both a fresh proxy and a reconfiguration. Now that sessions are always lazy, proxy.start(config) is enough: the new proxy starts with no preview and requests a connection when the first binding call arrives. Calling update(config) at startup would just pause a fresh proxy and invalidate work that hasn’t started. We still call it when updateBindings() replaces the configuration.
Readiness is still checked, but we now wait directly on proxy.ready, which resolves when the local Miniflare proxy is listening. localServerReady was the separate gate for the old eager path, so resolving it unconditionally would keep a redundant signal.
<!-- durable-reviewer:review run=fa90647f-8b4e-43aa-9c67-edf559517ab3 -->
Superseded by the review of cc3744bc.<details>
<summary>This review, of <code>b5384d63</code></summary>
✅ Approved — The latest commits keep the lazy-only refactor consistent. Attaching a no-op rejection handler to a custom authentication promise prevents an unhandled rejection before the first binding call, and the changeset documents the removed lazy option and the new startup timing. No correctness, security or performance issues were found.
<sub>The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.</sub>
---
<details>
<summary>✅ All checks passed</summary>
🚀 Release: ✅ LGTM
Overall risk: medium. Programmatic consumers of startRemoteProxySession() now see authentication and preview errors on binding calls instead of at startup. The changeset documents this, and the author has said the lazy option was never released. The pull request description says the credentialed e2e suite has not been run for this change.
---
🔒 Security: ✅ LGTM
No trust boundary is widened. With the eager constructor and timer paths gone, a login can no longer start without a binding request. Stale session state is cleared on token expiry and on a new bundle.
---
📖 AGENTS.md: ✅ LGTM
This change does not make any AGENTS.md guidance inaccurate.
---
📋 Code Quality: ✅ LGTM
startRemoteProxySession() now always waits on proxy.ready. The startup auth-error path collapses into the general wrapping, and the long-lived error listener still shows authentication guidance. If auth is a native promise, it gets a no-op rejection handler so that a rejection before the first binding call is not reported as unhandled. The promise itself is still passed through unchanged, so the rejection reaches the binding call. The updated tests cover that a custom authentication thenable stays lazy.
---
⚡ Performance: ✅ LGTM
No performance concerns.
---
📝 Documentation: ✅ LGTM
The changeset accurately describes the removed lazy option, local-only startup readiness, errors surfacing on binding calls, and that updateBindings() no longer waits for the remote preview.
</details>
---
<sub>Reviewed commit: b5384d63</sub>
</details>
<!-- devin-review-comment {"id": "ANALYSIS_pr-review-job-076d6ab698dc446e82eb8d2d86204e9a_0001", "file_path": "packages/remote-bindings/src/start-remote-proxy-session.ts", "start_line": 96, "end_line": 97, "side": "RIGHT", "kind": "analysis"} -->
🔍 No idle rejection handling for thenables
If a custom auth thenable wraps a running promise, Wrangler leaves its rejection unobserved until a binding call. Callers must handle earlier rejections themselves or pass an auth callback that starts the work on demand.
<!-- devin-review-badge-begin -->
<a href="https://cloudflare.devinenterprise.com/review/cloudflare/workers-sdk/pull/17209" target="_blank"><picture><source media="(prefers-color-scheme: dark)" srcset="https://static.devin.ai/assets/gh-devin-review-dark.svg?v=4"><img src="https://static.devin.ai/assets/gh-devin-review-light.svg?v=4" alt="Devin Review"></picture></a>
<!-- devin-review-badge-end -->
---
Was this helpful? React with 👍 or 👎 to provide feedback.
[!NOTE]
Newer findings are available below. Devin Review posted a newer report on this PR, in addition to the findings presented here.
Devin Review found 1 new potential issue.
<!-- devin-review-badge-begin -->
<a href="https://cloudflare.devinenterprise.com/review/cloudflare/workers-sdk/pull/17209" target="_blank"><picture><source media="(prefers-color-scheme: dark)" srcset="https://static.devin.ai/assets/gh-devin-review-dark.svg?v=4"><img src="https://static.devin.ai/assets/gh-devin-review-light.svg?v=4" alt="Devin Review"></picture></a>
<!-- devin-review-badge-end -->
<!-- durable-reviewer:review run=1f87af44-9fc8-4391-9c77-336b8364a753 -->
Superseded by the review of 5ca4e926.<details>
<summary>This review, of <code>cc3744bc</code></summary>
✅ Approved — No correctness, security or performance issues found. The updated tests cover the native-promise and custom-thenable authentication paths, and the changeset accurately documents the new startup and error timing.
<sub>The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.</sub>
---
<details>
<summary>✅ All checks passed</summary>
🚀 Release: ✅ LGTM
Overall risk: medium. Programmatic consumers of startRemoteProxySession() now get only local proxy readiness at startup. Authentication and preview failures surface on binding calls instead, and the changeset records this. The pull request description says the credentialed e2e suite was not run.
---
🔒 Security: ✅ LGTM
No trust boundary is widened. Without the eager and timer paths, a login can no longer start without a binding request. Token expiry and new bundles still clear stale session state.
---
📖 AGENTS.md: ✅ LGTM
This change does not make any AGENTS.md guidance inaccurate.
---
📋 Code Quality: ✅ LGTM
The new tests in lazy-remote-proxy-session.test.ts match the production code. A native auth promise gets a no-op rejection handler, so a rejection while idle is not reported as unhandled, and the first binding call still sees it as a 503. A custom thenable is not invoked until the first binding call. No leftover lazy, localServerReady or preview-refresh retry references remain in packages/remote-bindings.
---
⚡ Performance: ✅ LGTM
Removing the eager startup and timer paths adds no performance concerns.
---
📝 Documentation: ✅ LGTM
The changeset accurately describes local-only startup readiness, errors surfacing on binding calls, and updateBindings() no longer waiting for the remote preview.
</details>
---
<sub>Reviewed commit: cc3744bc</sub>
</details>
<!-- devin-review-comment {"id": "ANALYSIS_pr-review-job-be9027f5b7f049deb01684d2225fe78e_0001", "file_path": "packages/wrangler/e2e/remote-binding/remote-bindings-api.test.ts", "start_line": 160, "end_line": 160, "side": "RIGHT", "kind": "analysis"} -->
🔍 Live API wording in auth test
The invalid-token test requires Authentication failed, but DevEnv forwards that detail from the live API. A wording change can fail the test even when Wrangler returns the expected 503 and recovery guidance.
<!-- devin-review-badge-begin -->
<a href="https://cloudflare.devinenterprise.com/review/cloudflare/workers-sdk/pull/17209" target="_blank"><picture><source media="(prefers-color-scheme: dark)" srcset="https://static.devin.ai/assets/gh-devin-review-dark.svg?v=4"><img src="https://static.devin.ai/assets/gh-devin-review-light.svg?v=4" alt="Devin Review"></picture></a>
<!-- devin-review-badge-end -->
---
Was this helpful? React with 👍 or 👎 to provide feedback.
Devin Review found 1 new potential issue.
<!-- devin-review-badge-begin -->
<a href="https://cloudflare.devinenterprise.com/review/cloudflare/workers-sdk/pull/17209" target="_blank"><picture><source media="(prefers-color-scheme: dark)" srcset="https://static.devin.ai/assets/gh-devin-review-dark.svg?v=4"><img src="https://static.devin.ai/assets/gh-devin-review-light.svg?v=4" alt="Devin Review"></picture></a>
<!-- devin-review-badge-end -->
<!-- durable-reviewer:finding -->
ℹ️ INFO · Code Quality
The assertion on "Authentication failed" depends on upstream API error wording that no credentialed run has confirmed
The 503 body includes the message from the Cloudflare API error, so this check relies on the exact text the API returns for an invalid token. The description says the credentialed suite was not run, so this assertion has not been checked against the real API. The first three toContain checks already cover the auth guidance. Consider dropping this one, or confirm it with one credentialed run.
<!-- durable-reviewer:finding -->
💬 SUGGESTION · Code Quality
The auth-failure e2e fetch has no timeout, unlike the sibling test
This fetch to the proxy has no abort signal, but the matching test in the maybeStartOrUpdateRemoteProxySession block passes AbortSignal.timeout(15_000). If the proxy never answers, this test hangs until the Vitest timeout and fails with a less helpful message. Add the same signal here.
const response = await fetch(session.remoteProxyConnectionString, {
headers: { "MF-Binding": "MY_SERVICE" },
signal: AbortSignal.timeout(15_000),
});
<!-- durable-reviewer:review run=83374e34-1944-4155-9520-19703264d3b7 -->
Superseded by the review of 7c4fdc49.<details>
<summary>This review, of <code>5ca4e926</code></summary>
💬 Approved with comments — No correctness, security or performance issues. Two optional e2e-test robustness notes: a fetch with no timeout, and an assertion on upstream API error wording.
Findings: 1 info · 1 suggestion (2 are inline comments on the diff)
<sub>The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.</sub>
---
📋 Code Quality: 💬 1 info · 1 suggestion
Two small robustness notes on the updated e2e test; no production defects.
Recommendation: 💬 Optional Nits
packages/wrangler/e2e/remote-binding/remote-bindings-api.test.ts:160)packages/wrangler/e2e/remote-binding/remote-bindings-api.test.ts:150)<details>
<summary>View full review</summary>
fetch in "user provided incorrect auth data" (remote-bindings-api.test.ts:150-152) has no abort signal. Its sibling test at lines 221-224 uses AbortSignal.timeout(15_000).expect(message).toContain("Authentication failed") (line 160) depends on the error text the Cloudflare API returns for an invalid token. The credentialed suite has not been run against this assertion.The finally cleanup and the 30-second first-call timeout look correct.
</details>
---
<details>
<summary>✅ All other checks passed</summary>
🚀 Release: ✅ LGTM
Overall risk: medium. Programmatic consumers of startRemoteProxySession() now get only local proxy readiness at startup. Authentication and preview failures surface on binding calls instead, and the changeset records this. The description says the credentialed e2e suite was not run. No comparison with the previous release tag was done, because tag history is not available here.
---
🔒 Security: ✅ LGTM
The only change since the last review is test-only code. It adds no trust-boundary change and no secret; the incorrect token is a dummy string.
---
📖 AGENTS.md: ✅ LGTM
This change does not make any AGENTS.md guidance inaccurate.
---
⚡ Performance: ✅ LGTM
No performance concerns.
---
📝 Documentation: ✅ LGTM
The changeset still accurately describes the startup readiness and error-timing change.
</details>
---
<sub>Reviewed commit: 5ca4e926</sub>
</details>
✅ Resolved: The assertion on live API wording was removed, so the concern no longer applies.
✅ Resolved: This item was already marked resolved; it concerns deferred handling of custom thenables, unrelated to the current test-only changes.
<!-- durable-reviewer:review run=e1960a85-0dad-428e-8b63-82fb61dd1128 -->
Superseded by the review of f0009539.<details>
<summary>This review, of <code>7c4fdc49</code></summary>
✅ Approved — No correctness, security or performance issues, and both earlier e2e-test notes are fixed. The startup readiness change is recorded in the changeset.
<sub>The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.</sub>
---
<details>
<summary>✅ All checks passed</summary>
🚀 Release: ✅ LGTM
Overall risk: medium. startRemoteProxySession() now resolves on local proxy readiness only, and authentication and preview failures surface on binding calls. The changeset records this. The credentialed e2e suite was not run.
---
🔒 Security: ✅ LGTM
No trust-boundary changes and no secrets were introduced.
---
📖 AGENTS.md: ✅ LGTM
This change does not make any AGENTS.md guidance inaccurate.
---
📋 Code Quality: ✅ LGTM
The auth-failure e2e fetch now has a 15-second timeout. The test now asserts on Wrangler's own error text instead of upstream API wording. The lazy-only startup, update and timer-removal changes are consistent.
---
⚡ Performance: ✅ LGTM
No performance concerns.
---
📝 Documentation: ✅ LGTM
The changeset accurately describes the change in startup readiness and error timing.
</details>
---
<sub>Reviewed commit: 7c4fdc49</sub>
</details>
<!-- durable-reviewer:review run=a23f1311-eb73-4fb5-b0d4-915bd8be8014 -->
Superseded by the review of c5d10917.<details>
<summary>This review, of <code>f0009539</code></summary>
✅ Approved — No correctness, security or performance issues, and both earlier e2e-test notes are fixed. The startup readiness change is recorded in the changeset.
<sub>The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.</sub>
---
<details>
<summary>✅ All checks passed</summary>
🚀 Release: ✅ LGTM
Overall risk: medium. startRemoteProxySession() now resolves on local proxy readiness only, and authentication and preview failures surface on binding calls. The changeset records this. The credentialed e2e suite was not run.
---
🔒 Security: ✅ LGTM
No trust-boundary changes and no secrets were introduced.
---
📖 AGENTS.md: ✅ LGTM
This change does not make any AGENTS.md guidance inaccurate.
---
📋 Code Quality: ✅ LGTM
The auth-failure e2e fetch now has a 15-second timeout. The test now asserts on Wrangler's own error text instead of upstream API wording. The lazy-only startup, update and timer-removal changes are consistent.
---
⚡ Performance: ✅ LGTM
No performance concerns.
---
📝 Documentation: ✅ LGTM
The changeset accurately describes the change in startup readiness and error timing.
</details>
---
<sub>Reviewed commit: f0009539 — same changes as 7c4fdc49, so this is that commit's review (no new review was run; line numbers are as of 7c4fdc49)</sub>
</details>
<!-- durable-reviewer:review run=f2e8b6a3-67ba-4c19-9d31-ab8d067bb558 -->
✅ Approved — No correctness, security or performance issues, and both earlier e2e-test notes are fixed. The startup readiness change is recorded in the changeset.
<sub>The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.</sub>
---
<details>
<summary>✅ All checks passed</summary>
🚀 Release: ✅ LGTM
Overall risk: medium. startRemoteProxySession() now resolves on local proxy readiness only, and authentication and preview failures surface on binding calls. The changeset records this. The credentialed e2e suite was not run.
---
🔒 Security: ✅ LGTM
No trust-boundary changes and no secrets were introduced.
---
📖 AGENTS.md: ✅ LGTM
This change does not make any AGENTS.md guidance inaccurate.
---
📋 Code Quality: ✅ LGTM
The auth-failure e2e fetch now has a 15-second timeout. The test now asserts on Wrangler's own error text instead of upstream API wording. The lazy-only startup, update and timer-removal changes are consistent.
---
⚡ Performance: ✅ LGTM
No performance concerns.
---
📝 Documentation: ✅ LGTM
The changeset accurately describes the change in startup readiness and error timing.
</details>
---
<sub>Reviewed commit: c5d10917 — same changes as 7c4fdc49, so this is that commit's review (no new review was run; line numbers are as of 7c4fdc49)</sub>
dario-piotrowicz
petebacondarwin
Stacked on #17198. Draft for evaluation; do not merge as-is without deciding how to handle the programmatic API compatibility change.
Make all remote binding sessions connect on the first binding call and remove the
lazyoption and eager constructor, reload, and timer paths. Existing local-dev integrations already use lazy sessions, and #17198 isolatesgetPlatformProxy()authentication in the subprocess. Remote Hyperdrive still makes its first binding call during startup to fetch bridge credentials.Compatibility to evaluate: Wrangler's exported
startRemoteProxySession()currently lets consumers rely on startup rejecting on remote connection failure. With this change, it andsession.readyonly signal local proxy readiness; authentication and preview errors surface on binding calls.updateBindings()no longer waits for remote preview setup. The draft updates the unreleased changeset; review the release strategy before merging.Local verification: 73 remote-bindings tests, 41 focused Wrangler tests, shared package build and typecheck, and formatting/lint. Updated the credentialed e2e assertion but did not run the credentialed suite.
---
- [x] Tests included/updated
- [ ] Automated tests not possible - manual testing has been completed as follows:
- [ ] Additional testing not necessary because:
- [ ] Cloudflare docs PR(s):
- [x] Documentation not necessary because: this is an evaluation draft; the API timing change and migration are recorded in the API comments and unreleased changeset. Revisit public docs before merging if the change proceeds.
<!-- devin-review-badge-begin -->
---
<a href="https://cloudflare.devinenterprise.com/review/cloudflare/workers-sdk/pull/17209" target="_blank"><picture><source media="(prefers-color-scheme: dark)" srcset="https://static.devin.ai/assets/gh-devin-review-dark.svg?v=4"><img src="https://static.devin.ai/assets/gh-devin-review-light.svg?v=4" alt="Devin Review"></picture></a>
<!-- devin-review-badge-end -->