Skip to content

feat(host-cloudflare): use dynamic-worker runtime when LOADER binding present#1452

Open
alanpog wants to merge 1 commit into
UsefulSoftwareCo:mainfrom
shellyn-ai:dynamic-worker-loader
Open

feat(host-cloudflare): use dynamic-worker runtime when LOADER binding present#1452
alanpog wants to merge 1 commit into
UsefulSoftwareCo:mainfrom
shellyn-ai:dynamic-worker-loader

Conversation

@alanpog

@alanpog alanpog commented Jul 23, 2026

Copy link
Copy Markdown

Swaps the Cloudflare host's code substrate from QuickJS-wasm to @executor-js/runtime-dynamic-worker (the cloud substrate) whenever the Worker declares a worker_loaders LOADER binding, falling back to QuickJS when the binding is absent — the one-Layer change the comment in src/execution.ts predicted. Existing self-host deployments without the binding are unaffected.

Verified on a live self-host deployment (account with Worker Loaders access):

  • sandboxed code runs in real workerd isolates (navigator.userAgent === "Cloudflare-Workers")
  • platform-enforced zero egress: fetch() throws ("This worker is not permitted to access the internet"); the only exit is the RPC tool bridge through the host
  • codemode tool calls and require_approval pause/resume behave identically to the QuickJS substrate

Notes:

  • The worker_loaders block in wrangler.jsonc makes dynamic-worker the default for new deployments; deployments preferring QuickJS (or without Worker Loaders access) can remove the block — the conditional keeps both paths live. Happy to flip the default to opt-in if you'd rather.
  • No changeset included since apps/host-cloudflare is private/unpublished (per Remove changeset that only targets ignored packages #1444); can add one if you want it recorded.
  • Gates run locally on this branch: format:check, host-cloudflare typecheck and test.

… present

Swap the Cloudflare host's code substrate from QuickJS-wasm to
@executor-js/runtime-dynamic-worker (the cloud substrate) whenever the
Worker declares a worker_loaders LOADER binding; fall back to QuickJS
when the binding is absent, so existing self-host deployments are
unaffected.

Verified on a live deployment: sandboxed code runs in real workerd
isolates (navigator.userAgent === "Cloudflare-Workers") with
platform-enforced zero egress — fetch() throws and the only exit is the
RPC tool bridge through the host.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant