github cloudflare/ai @cloudflare/tanstack-ai@0.2.0

Minor Changes

  • #590 fe0d182 Thanks @threepointone! - - Add resumable streaming to the Workers AI adapter (coming soon — not
    generally available yet while the AI Gateway resume backend rolls out; treat as
    experimental): catalog models dispatch through the AI Gateway run path, so
    transient mid-stream drops reconnect transparently via cf-aig-run-id.
    Configure with resume / onResumeExpired (no-op + warning where no run id is
    available, e.g. REST).

    • Gain the gpt-oss forced tool-call salvage (#560) and non-SSE
      graceful-degradation, now shared with workers-ai-provider.
    • Bump @tanstack/ai and the @tanstack/ai-* adapter peers to current versions
      (adapts to the multimodal MediaPrompt API). @ai-sdk/* is intentionally not
      bumped.
  • #594 12fb307 Thanks @threepointone! - Retry transient Workers AI failures and normalize errors across every adapter.

    • Chat: the binding shim now surfaces binding failures as HTTP responses
      (e.g. "out of capacity" 3040429, "no such model" 5007400) so the
      OpenAI SDK's status-based retry engages and honors Retry-After. Aborts and
      unrecognized errors propagate untouched. Non-OK gateway run-path responses are
      returned verbatim instead of being swallowed into an empty completion.
    • Non-chat adapters (embedding, image, TTS, transcription, summarize) gain a
      bounded exponential-backoff retry (the OpenAI SDK isn't in play for these) and
      normalize binding / REST / gateway failures into a single WorkersAiRequestError
      carrying the HTTP status (and the raw Workers AI code when recognized). The
      retry loop honors a server Retry-After header. Non-OK gateway responses are no
      longer swallowed.
    • Add a maxRetries option to the adapter config: forwarded to the OpenAI SDK on
      the chat path, and used by the non-chat retry loop. Defaults to 2; set to 0
      to disable.

Don't miss a new ai release

NewReleases is sending notifications on new releases.