← Back to Pull requests

[wrangler] Make remote binding sessions lazy only #17209

Open
petebacondarwin opened this pull request with 957 lines diff across 22 files
View on GitHub
petebacondarwin petebacondarwin commented on Nov 26, 2026 16:55 UTC
Author

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 lazy option and eager constructor, reload, and timer paths. Existing local-dev integrations already use lazy sessions, and #17198 isolates getPlatformProxy() 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 and session.ready only 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.

---

  • Tests

  • - [x] Tests included/updated
    - [ ] Automated tests not possible - manual testing has been completed as follows:
    - [ ] Additional testing not necessary because:
  • Public documentation

  • - [ ] 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 -->

    Diff: 957 lines (+272 / -685) across 22 files Reviewer: dario-piotrowicz Review duration: 8004m
    All Vouch review confidence checks passed
    Residual risk 0.06 = Change Risk (0.72) × (1 − Review Confidence (0.92)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.72 · 957 lines diff across 22 files
    0.72
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.93 · 5 substantive comment(s)
    0.93
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 50%
    92%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.400
    Mass File Touch mass_file_touch
    0.080
    Real PR Conversation Timeline
    45 items
    changeset-bot[bot] changeset-bot[bot] commented on Nov 26, 2026 16:55 UTC
    Bot

    ⚠️ 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

    ask-bonk[bot] ask-bonk[bot] commented on Nov 26, 2026 16:56 UTC
    Bot

    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
    

    ask-bonk[bot] ask-bonk[bot] commented on Nov 26, 2026 16:56 UTC
    Bot

    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-ai-integration[bot] devin-ai-integration[bot] commented on code on Nov 26, 2026 16:57 UTC
    Code Review
    packages/wrangler/e2e/remote-binding/remote-bindings-api.test.ts:1

    <!-- 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-ai-integration[bot] devin-ai-integration[bot] commented on code on Nov 26, 2026 16:57 UTC
    Code Review
    .changeset/quiet-remote-only-bindings.md:1
    @@ -11,3 +11,5 @@ Local development now starts without logging in, even when a project uses remote
     This applies to Wrangler, the Cloudflare Vite plugin, and the Vitest plugin.
     
     Remote Hyperdrive's first binding call happens during startup: Miniflare requests database credentials to set up the local bridge.
    +
    +Wrangler's programmatic `startRemoteProxySession()` also defers authentication and remote preview setup until the first binding call. Remove the `lazy` option from calls to this API. 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.

    <!-- 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-ai-integration[bot] devin-ai-integration[bot] commented on code on Nov 26, 2026 16:57 UTC
    Code Review
    packages/wrangler/src/api/remoteBindings/start-remote-proxy-session.ts:1
    @@ -20,6 +20,7 @@ export type StartRemoteProxySessionOptions = Omit<
     	auth?: AsyncHook<CfAccount>;
     };
     
    +/** Start the local proxy. Remote authentication and preview setup wait for a binding call. */

    <!-- 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.

    devin-ai-integration[bot] devin-ai-integration[bot] commented on Nov 26, 2026 16:57 UTC
    Reviewer

    [!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 -->

    pkg-pr-new[bot] pkg-pr-new[bot] commented on Nov 26, 2026 16:58 UTC
    Bot

    <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>_

    petebacondarwin petebacondarwin commented on code on Nov 26, 2026 17:15 UTC
    Code Review
    .changeset/quiet-remote-only-bindings.md:1
    @@ -11,3 +11,5 @@ Local development now starts without logging in, even when a project uses remote
     This applies to Wrangler, the Cloudflare Vite plugin, and the Vitest plugin.
     
     Remote Hyperdrive's first binding call happens during startup: Miniflare requests database credentials to set up the local bridge.
    +
    +Wrangler's programmatic `startRemoteProxySession()` also defers authentication and remote preview setup until the first binding call. Remove the `lazy` option from calls to this API. 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.

    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.
    

    petebacondarwin petebacondarwin commented on code on Nov 26, 2026 17:15 UTC
    Code Review
    .changeset/quiet-remote-only-bindings.md:1
    @@ -11,3 +11,5 @@ Local development now starts without logging in, even when a project uses remote
     This applies to Wrangler, the Cloudflare Vite plugin, and the Vitest plugin.
     
     Remote Hyperdrive's first binding call happens during startup: Miniflare requests database credentials to set up the local bridge.
    +
    +Wrangler's programmatic `startRemoteProxySession()` also defers authentication and remote preview setup until the first binding call. Remove the `lazy` option from calls to this API. 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.

    petebacondarwin petebacondarwin commented on code on Nov 26, 2026 17:16 UTC
    Code Review
    .changeset/quiet-remote-only-bindings.md:1
    @@ -11,3 +11,5 @@ Local development now starts without logging in, even when a project uses remote
     This applies to Wrangler, the Cloudflare Vite plugin, and the Vitest plugin.
     
     Remote Hyperdrive's first binding call happens during startup: Miniflare requests database credentials to set up the local bridge.
    +
    +Wrangler's programmatic `startRemoteProxySession()` also defers authentication and remote preview setup until the first binding call. Remove the `lazy` option from calls to this API. 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 the lazy property was never released, and the behaviour change is an acceptable non-breaking change in our view.

    devin-ai-integration[bot] devin-ai-integration[bot] commented on code on Nov 26, 2026 17:27 UTC
    Code Review
    .changeset/quiet-remote-only-bindings.md:1
    @@ -11,3 +11,5 @@ Local development now starts without logging in, even when a project uses remote
     This applies to Wrangler, the Cloudflare Vite plugin, and the Vitest plugin.
     
     Remote Hyperdrive's first binding call happens during startup: Miniflare requests database credentials to set up the local bridge.
    +
    +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.

    <!-- 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.

    devin-ai-integration[bot] devin-ai-integration[bot] commented on Nov 26, 2026 17:27 UTC
    Reviewer

    [!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-ai-integration[bot] devin-ai-integration[bot] commented on code on Nov 26, 2026 17:35 UTC
    Code Review
    packages/remote-bindings/src/start-remote-proxy-session.ts:1
    @@ -98,6 +91,12 @@ export async function startRemoteProxySession(
     	bindings: StartDevWorkerInput["bindings"],
     	options: StartRemoteProxySessionOptions
     ): Promise<RemoteProxySession> {
    +	let auth = options.auth;
    +	if (typeof auth !== "function" && "then" in auth) {
    +		auth = Promise.resolve(auth);
    +		void auth.catch(() => {});

    <!-- 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.

    devin-ai-integration[bot] devin-ai-integration[bot] commented on Nov 26, 2026 17:35 UTC
    Reviewer

    [!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 -->

    workers-devprod workers-devprod commented on Nov 26, 2026 17:42 UTC
    Contributor

    Codeowners approval required for this PR:

  • ✅ @cloudflare/wrangler
  • <details><summary>Show detailed file reviewers</summary>

    </details>

    dario-piotrowicz dario-piotrowicz commented on code on Nov 26, 2026 17:42 UTC
    Code Review
    packages/remote-bindings/src/startDevWorker/types.ts:1
    @@ -18,7 +18,6 @@ export type StartDevWorkerOptions = {
     	complianceRegion: Config["compliance_region"];
     	auth: AsyncHook<CfAccount>;
     	/** Establish the remote connection only when a binding request arrives. */

    clanky-the-clanker[bot] clanky-the-clanker[bot] commented on code on Nov 26, 2026 17:44 UTC
    Code Review
    packages/remote-bindings/src/startDevWorker/types.ts:1
    @@ -18,7 +18,6 @@ export type StartDevWorkerOptions = {
     	complianceRegion: Config["compliance_region"];
     	auth: AsyncHook<CfAccount>;
     	/** Establish the remote connection only when a binding request arrives. */

    <!-- 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.

    clanky-the-clanker[bot] clanky-the-clanker[bot] commented on code on Nov 26, 2026 17:44 UTC
    Code Review
    .changeset/quiet-remote-only-bindings.md:1
    @@ -11,3 +11,7 @@ Local development now starts without logging in, even when a project uses remote
     This applies to Wrangler, the Cloudflare Vite plugin, and the Vitest plugin.
     
     Remote Hyperdrive's first binding call happens during startup: Miniflare requests database credentials to set up the local bridge.
    +
    +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.
    +
    +If you already pass `lazy: true` to `startRemoteProxySession()`, remove that option. Connection timing stays the same.

    <!-- 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.

    clanky-the-clanker[bot] clanky-the-clanker[bot] commented on Nov 26, 2026 17:44 UTC
    Reviewer

    <!-- 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

  • [INFO] Orphaned JSDoc left above server after the lazy field was removed. (packages/remote-bindings/src/startDevWorker/types.ts:20)

  • [INFO] Changeset migration line refers to an unreleased 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

  • [QUESTION] Is 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>

    clanky-the-clanker[bot] clanky-the-clanker[bot] commented on Nov 26, 2026 17:46 UTC
    Reviewer

    <!-- 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>

    devin-ai-integration[bot] devin-ai-integration[bot] commented on code on Nov 26, 2026 18:04 UTC
    Code Review
    packages/remote-bindings/src/start-remote-proxy-session.ts:1
    @@ -98,6 +91,12 @@ export async function startRemoteProxySession(
     	bindings: StartDevWorkerInput["bindings"],
     	options: StartRemoteProxySessionOptions
     ): Promise<RemoteProxySession> {
    +	let auth = options.auth;
    +	if (typeof auth !== "function" && "then" in auth) {
    +		auth = Promise.resolve(auth);
    +		void auth.catch(() => {});

    ✅ 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-ai-integration[bot] devin-ai-integration[bot] commented on code on Nov 26, 2026 18:05 UTC
    Code Review
    .changeset/quiet-remote-only-bindings.md:1
    @@ -11,3 +11,5 @@ Local development now starts without logging in, even when a project uses remote
     This applies to Wrangler, the Cloudflare Vite plugin, and the Vitest plugin.
     
     Remote Hyperdrive's first binding call happens during startup: Miniflare requests database credentials to set up the local bridge. A definitive account or authentication rejection fails startup with the original diagnostic. Transient connection failures are retried and do not prevent other bindings from working.
    +
    +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.

    <!-- 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.

    devin-ai-integration[bot] devin-ai-integration[bot] commented on Nov 26, 2026 18:05 UTC
    Reviewer

    [!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 -->

    clanky-the-clanker[bot] clanky-the-clanker[bot] commented on Nov 26, 2026 18:05 UTC
    Reviewer

    <!-- 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>

    petebacondarwin petebacondarwin commented on code on Nov 26, 2026 18:09 UTC
    Code Review
    .changeset/quiet-remote-only-bindings.md:1
    @@ -11,3 +11,5 @@ Local development now starts without logging in, even when a project uses remote
     This applies to Wrangler, the Cloudflare Vite plugin, and the Vitest plugin.
     
     Remote Hyperdrive's first binding call happens during startup: Miniflare requests database credentials to set up the local bridge. A definitive account or authentication rejection fails startup with the original diagnostic. Transient connection failures are retried and do not prevent other bindings from working.
    +
    +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.

    lazy was never released and this is updating the changeset that introduced it.

    dario-piotrowicz dario-piotrowicz commented on code on Nov 26, 2026 22:40 UTC
    Code Review
    packages/remote-bindings/src/startDevWorker/DevEnv.ts:1
    @@ -17,19 +17,12 @@ export class DevEnv extends EventEmitter {
     
     	start() {
     		this.proxy.start(this.#config);
    -		this.update(this.#config);
    -		if (this.#config.lazy) {
    -			this.proxy.localServerReady.resolve();
    -		}

    why these changes? is lazy becomes the only mode, shouldn't this code remain here and be run unconditionally instead of it being removed?

    dario-piotrowicz dario-piotrowicz approved these changes on Nov 26, 2026 22:42 UTC
    Approved Reviewer

    Makes sense to me

    workers-devprod workers-devprod approved these changes on Nov 26, 2026 22:43 UTC
    Approved Reviewer

    Codeowners reviews satisfied

    petebacondarwin petebacondarwin commented on code on Nov 27, 2026 07:02 UTC
    Code Review
    packages/remote-bindings/src/startDevWorker/DevEnv.ts:1
    @@ -17,19 +17,12 @@ export class DevEnv extends EventEmitter {
     
     	start() {
     		this.proxy.start(this.#config);
    -		this.update(this.#config);
    -		if (this.#config.lazy) {
    -			this.proxy.localServerReady.resolve();
    -		}

    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.

    clanky-the-clanker[bot] clanky-the-clanker[bot] commented on Nov 27, 2026 07:22 UTC
    Reviewer

    <!-- 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-ai-integration[bot] devin-ai-integration[bot] commented on code on Nov 27, 2026 07:26 UTC
    Code Review
    packages/remote-bindings/src/start-remote-proxy-session.ts:1
    @@ -98,6 +92,11 @@ export async function startRemoteProxySession(
     	bindings: StartDevWorkerInput["bindings"],
     	options: StartRemoteProxySessionOptions
     ): Promise<RemoteProxySession> {
    +	const { auth } = options;
    +	if (types.isPromise(auth)) {
    +		void Promise.prototype.then.call(auth, undefined, () => {});

    <!-- 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.

    devin-ai-integration[bot] devin-ai-integration[bot] commented on Nov 27, 2026 07:26 UTC
    Reviewer

    [!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 -->

    clanky-the-clanker[bot] clanky-the-clanker[bot] commented on Nov 27, 2026 07:27 UTC
    Reviewer

    <!-- 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-ai-integration[bot] devin-ai-integration[bot] commented on code on Nov 27, 2026 08:00 UTC
    Code Review
    packages/wrangler/e2e/remote-binding/remote-bindings-api.test.ts:1
    @@ -133,36 +130,37 @@ describe.skipIf(!CLOUDFLARE_ACCOUNT_ID)(
     			});
     
     			test("user provided incorrect auth data", async ({ expect }) => {
    -				let error: unknown;
    -				try {
    -					await startRemoteProxySession(
    -						{
    -							MY_SERVICE: {
    -								type: "service",
    -								service: remoteWorkerName,
    -							},
    +				const session = await startRemoteProxySession(
    +					{
    +						MY_SERVICE: {
    +							type: "service",
    +							service: remoteWorkerName,
     						},
    -						{
    -							auth: {
    -								accountId: CLOUDFLARE_ACCOUNT_ID,
    -								apiToken: {
    -									apiToken: "This is an incorrect API TOKEN!",
    -								},
    +					},
    +					{
    +						auth: {
    +							accountId: CLOUDFLARE_ACCOUNT_ID,
    +							apiToken: {
    +								apiToken: "This is an incorrect API TOKEN!",
     							},
    -						}
    +						},
    +					}
    +				);
    +				try {
    +					const response = await fetch(session.remoteProxyConnectionString, {
    +						headers: { "MF-Binding": "MY_SERVICE" },
    +					});
    +					expect(response.status).toBe(503);
    +					const message = await response.text();
    +					expect(message).toContain(
    +						"the remote session could not be authenticated."
     					);
    -				} catch (e) {
    -					error = e;
    +					expect(message).toContain("`CLOUDFLARE_API_TOKEN`");
    +					expect(message).toContain("`wrangler whoami`");
    +					expect(message).toContain("Authentication failed");

    <!-- 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-ai-integration[bot] devin-ai-integration[bot] commented on Nov 27, 2026 08:00 UTC
    Reviewer

    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 -->

    clanky-the-clanker[bot] clanky-the-clanker[bot] commented on code on Nov 27, 2026 08:01 UTC
    Code Review
    packages/wrangler/e2e/remote-binding/remote-bindings-api.test.ts:1
    @@ -133,36 +130,37 @@ describe.skipIf(!CLOUDFLARE_ACCOUNT_ID)(
     			});
     
     			test("user provided incorrect auth data", async ({ expect }) => {
    -				let error: unknown;
    -				try {
    -					await startRemoteProxySession(
    -						{
    -							MY_SERVICE: {
    -								type: "service",
    -								service: remoteWorkerName,
    -							},
    +				const session = await startRemoteProxySession(
    +					{
    +						MY_SERVICE: {
    +							type: "service",
    +							service: remoteWorkerName,
     						},
    -						{
    -							auth: {
    -								accountId: CLOUDFLARE_ACCOUNT_ID,
    -								apiToken: {
    -									apiToken: "This is an incorrect API TOKEN!",
    -								},
    +					},
    +					{
    +						auth: {
    +							accountId: CLOUDFLARE_ACCOUNT_ID,
    +							apiToken: {
    +								apiToken: "This is an incorrect API TOKEN!",
     							},
    -						}
    +						},
    +					}
    +				);
    +				try {
    +					const response = await fetch(session.remoteProxyConnectionString, {
    +						headers: { "MF-Binding": "MY_SERVICE" },
    +					});
    +					expect(response.status).toBe(503);
    +					const message = await response.text();
    +					expect(message).toContain(
    +						"the remote session could not be authenticated."
     					);
    -				} catch (e) {
    -					error = e;
    +					expect(message).toContain("`CLOUDFLARE_API_TOKEN`");
    +					expect(message).toContain("`wrangler whoami`");
    +					expect(message).toContain("Authentication failed");

    <!-- 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.

    clanky-the-clanker[bot] clanky-the-clanker[bot] commented on code on Nov 27, 2026 08:01 UTC
    Code Review
    packages/wrangler/e2e/remote-binding/remote-bindings-api.test.ts:1
    @@ -133,36 +130,37 @@ describe.skipIf(!CLOUDFLARE_ACCOUNT_ID)(
     			});
     
     			test("user provided incorrect auth data", async ({ expect }) => {
    -				let error: unknown;
    -				try {
    -					await startRemoteProxySession(
    -						{
    -							MY_SERVICE: {
    -								type: "service",
    -								service: remoteWorkerName,
    -							},
    +				const session = await startRemoteProxySession(
    +					{
    +						MY_SERVICE: {
    +							type: "service",
    +							service: remoteWorkerName,
     						},
    -						{
    -							auth: {
    -								accountId: CLOUDFLARE_ACCOUNT_ID,
    -								apiToken: {
    -									apiToken: "This is an incorrect API TOKEN!",
    -								},
    +					},
    +					{
    +						auth: {
    +							accountId: CLOUDFLARE_ACCOUNT_ID,
    +							apiToken: {
    +								apiToken: "This is an incorrect API TOKEN!",
     							},
    -						}
    +						},
    +					}
    +				);
    +				try {
    +					const response = await fetch(session.remoteProxyConnectionString, {
    +						headers: { "MF-Binding": "MY_SERVICE" },
    +					});

    <!-- 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),
    					});
    

    clanky-the-clanker[bot] clanky-the-clanker[bot] commented on Nov 27, 2026 08:01 UTC
    Reviewer

    <!-- 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

  • [INFO] The assertion on "Authentication failed" depends on upstream API error wording that no credentialed run has confirmed (packages/wrangler/e2e/remote-binding/remote-bindings-api.test.ts:160)

  • [SUGGESTION] The auth-failure e2e fetch has no timeout, unlike the sibling test (packages/wrangler/e2e/remote-binding/remote-bindings-api.test.ts:150)
  • <details>
    <summary>View full review</summary>

  • The 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>

    devin-ai-integration[bot] devin-ai-integration[bot] commented on code on Nov 27, 2026 08:28 UTC
    Code Review
    packages/wrangler/e2e/remote-binding/remote-bindings-api.test.ts:1
    @@ -133,36 +130,37 @@ describe.skipIf(!CLOUDFLARE_ACCOUNT_ID)(
     			});
     
     			test("user provided incorrect auth data", async ({ expect }) => {
    -				let error: unknown;
    -				try {
    -					await startRemoteProxySession(
    -						{
    -							MY_SERVICE: {
    -								type: "service",
    -								service: remoteWorkerName,
    -							},
    +				const session = await startRemoteProxySession(
    +					{
    +						MY_SERVICE: {
    +							type: "service",
    +							service: remoteWorkerName,
     						},
    -						{
    -							auth: {
    -								accountId: CLOUDFLARE_ACCOUNT_ID,
    -								apiToken: {
    -									apiToken: "This is an incorrect API TOKEN!",
    -								},
    +					},
    +					{
    +						auth: {
    +							accountId: CLOUDFLARE_ACCOUNT_ID,
    +							apiToken: {
    +								apiToken: "This is an incorrect API TOKEN!",
     							},
    -						}
    +						},
    +					}
    +				);
    +				try {
    +					const response = await fetch(session.remoteProxyConnectionString, {
    +						headers: { "MF-Binding": "MY_SERVICE" },
    +					});
    +					expect(response.status).toBe(503);
    +					const message = await response.text();
    +					expect(message).toContain(
    +						"the remote session could not be authenticated."
     					);
    -				} catch (e) {
    -					error = e;
    +					expect(message).toContain("`CLOUDFLARE_API_TOKEN`");
    +					expect(message).toContain("`wrangler whoami`");
    +					expect(message).toContain("Authentication failed");

    ✅ Resolved: The assertion on live API wording was removed, so the concern no longer applies.

    devin-ai-integration[bot] devin-ai-integration[bot] commented on code on Nov 27, 2026 08:28 UTC
    Code Review
    packages/remote-bindings/src/start-remote-proxy-session.ts:1
    @@ -98,6 +92,11 @@ export async function startRemoteProxySession(
     	bindings: StartDevWorkerInput["bindings"],
     	options: StartRemoteProxySessionOptions
     ): Promise<RemoteProxySession> {
    +	const { auth } = options;
    +	if (types.isPromise(auth)) {
    +		void Promise.prototype.then.call(auth, undefined, () => {});

    ✅ Resolved: This item was already marked resolved; it concerns deferred handling of custom thenables, unrelated to the current test-only changes.

    clanky-the-clanker[bot] clanky-the-clanker[bot] commented on Nov 27, 2026 08:29 UTC
    Reviewer

    <!-- 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>

    clanky-the-clanker[bot] clanky-the-clanker[bot] commented on Nov 30, 2026 15:25 UTC
    Reviewer

    <!-- 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>

    clanky-the-clanker[bot] clanky-the-clanker[bot] commented on Nov 30, 2026 15:45 UTC
    Reviewer

    <!-- 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>

    Assignees
    petebacondarwin petebacondarwin
    Labels
    risk: low confidence: 92% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 71.5% (HIGH) · Higher = larger blast radius
    71.5%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 92% · Lower = rushed or shallow review
    92%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 5.7% · Safe to merge
    5.7%