Skip to content

SDK 0.1.10 cannot type a first worker_loader script upload #99

Closed

Description

@elliothux

Reproduction

With @open-compute/sdk 0.1.10, OpenComputeWorkerVersionCreateParams correctly includes OpenComputeWorkerLoaderBinding, but OpenComputeWorkersScriptsNode.update is still typed as BaseScripts["update"].

A new script cannot use versions.create as a workaround: POST /accounts/{account}/workers/scripts/{script}/versions requires the script to exist and returns Cloudflare error 9100003 (the request is invalid) when it does not. The first upload must therefore use scripts.update, whose ScriptUpdateParams binding union rejects worker_loader at compile time.

Expected

The closed SDK surface should provide a type-safe first-upload operation for the runtime-supported worker_loader binding, ideally by augmenting scripts.update params in the same way as versions.create.

Impact

Dynamic Worker hosts need either a local declaration patch/type assertion or a temporary bootstrap Worker before they can upload their real first version. Runtime behavior already accepts worker_loader through the script upload endpoint.

Activity

  1. elliothux commented on Sep 21, 2026

    @elliothux
    OwnerAuthor

    Confirmed this is still present in the paired ocd 0.2.0 / @open-compute/sdk 0.2.0 release.

    The generated SDK correctly exports OpenComputeWorkerLoaderBinding and includes it in OpenComputeWorkerVersionCreateParams, but OpenComputeWorkersScriptsNode.update remains:

    readonly update: BaseScripts["update"];

    As a result, the first scripts.update upload still rejects a { type: "worker_loader", name: string } binding at compile time. The OCD 0.2.0 capability document reports worker_loader as supported for multipart bindings, so the remaining gap is the SDK surface.

    The downstream package patch has been removed. Lynx currently keeps a narrow local adapter around this one call. Exporting an OpenComputeWorkerScriptUpdateParams type and using it for scripts.update, analogous to OpenComputeWorkerVersionCreateParams, would remove that adapter.

  2. elliothux commented on Sep 22, 2026

    @elliothux
    OwnerAuthor

    Implemented in 60f931e0c.

    The SDK now types and serializes the first worker_loader upload correctly, including the pinned multipart metadata shape. Regression coverage includes SDK client tests and the real p6-cloudflare-sdk Gate.

    Implementation notes and acceptance evidence: docs/i99-100-sdk-upload-r2-recreate.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions