Skip to content

[miniflare/wrangler] Revert AI Search RPC workaround#12691

Merged
penalosa merged 2 commits intomainfrom
penalosa/remove-ai-search-workaround
Mar 2, 2026
Merged

[miniflare/wrangler] Revert AI Search RPC workaround#12691
penalosa merged 2 commits intomainfrom
penalosa/remove-ai-search-workaround

Conversation

@penalosa
Copy link
Contributor

@penalosa penalosa commented Feb 26, 2026

Reverts the workaround introduced in #12543 (commit 5a868a0c0).

That PR worked around capnweb classifying the raw AI binding's workerd-internal prototype as "unsupported", causing "RPC stub points at a non-serializable type", by threading a MF-Binding-Type: ai query param through the proxy stack and wrapping the binding in a plain object exposing only the aiSearch method.

This removes that workaround now that it's been fixed properly upstream.

Changes:

  • Remove bindingType param from remoteProxyClientWorker() and the "ai" callsite in the AI plugin
  • Remove bindingType / MF-Binding-Type from RemoteBindingEnv and ProxyMetadata
  • Remove MF-Binding-Type passthrough in remote-proxy-client.worker.ts
  • Remove AI_RPC_METHODS constant and wrapping block from ProxyServerWorker.ts
  • Delete proxy-server-ai-rpc.test.ts

  • Tests
    • Tests included/updated
    • Automated tests not possible - manual testing has been completed as follows:
    • Additional testing not necessary because: this is a pure revert of a workaround
  • Public documentation
    • Documentation not necessary because: internal implementation detail

Open with Devin

The workaround added MF-Binding-Type threading and a plain-object
wrapper in ProxyServerWorker to work around capnweb classifying the
raw AI binding prototype as unsupported. This has since been fixed
properly upstream, so remove the workaround cleanly.
@changeset-bot
Copy link

changeset-bot bot commented Feb 26, 2026

🦋 Changeset detected

Latest commit: bad5f07

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

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

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

@claude
Copy link
Contributor

claude bot commented Feb 26, 2026

Claude encountered an error —— View job


Changeset Review Image

Reviewing the changeset file...

Todo List:

  • Read changeset guidelines from .changeset/README.md
  • Read the changeset file .changeset/remove-ai-search-workaround.md
  • Validate changeset against criteria
  • Check for cute animal images
  • Provide final feedback

@penalosa penalosa marked this pull request as ready for review February 26, 2026 20:32
@penalosa penalosa requested a review from a team as a code owner February 26, 2026 20:32
@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 26, 2026

create-cloudflare

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

@cloudflare/kv-asset-handler

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

miniflare

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

@cloudflare/pages-shared

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

@cloudflare/unenv-preset

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

@cloudflare/vite-plugin

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

@cloudflare/vitest-pool-workers

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

@cloudflare/workers-editor-shared

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

@cloudflare/workers-utils

npm i https://pkg.pr.new/@cloudflare/workers-utils@12691

wrangler

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

commit: bad5f07

Copy link
Contributor

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

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 2 additional findings.

Open in Devin Review

@github-project-automation github-project-automation bot moved this from Untriaged to Approved in workers-sdk Feb 27, 2026
@penalosa penalosa merged commit 596b8a0 into main Mar 2, 2026
41 of 45 checks passed
@penalosa penalosa deleted the penalosa/remove-ai-search-workaround branch March 2, 2026 12:25
@github-project-automation github-project-automation bot moved this from Approved to Done in workers-sdk Mar 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants