Version Packages#394
Merged
threepointone merged 2 commits intomainfrom Feb 11, 2026
Merged
Conversation
1064f8b to
c9bd602
Compare
commit: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.
Releases
workers-ai-provider@3.0.5
Patch Changes
#393
91b32e0Thanks @threepointone! - Comprehensive cleanup of the workers-ai-provider package.Bug fixes:
fetch-event-streamthat caused runtime crashes when installed outside the monorepo. Replaced with a built-in SSE parser.ReadableStreamstart()pattern that buffered all chunks, and a heuristic that silently fell back to non-streamingdoGeneratewhenever tools were defined. Both are fixed. Streaming now uses a properTransformStreampipeline with backpressure.reasoning-deltaID mismatch in simulated streaming — was usinggenerateId()instead of thereasoningIdfrom the precedingreasoning-startevent, causing the AI SDK to drop reasoning content.createRun) silently swallowing HTTP errors. Non-200 responses now throw with status code and response body.response_formatbeing sent asundefinedon every non-JSON request. Now only included when actually set.json_schemafield evaluating tofalse(a boolean) instead ofundefinedwhen schema was missing.Workers AI quirk workarounds:
sanitizeToolCallId()— strips non-alphanumeric characters and pads/truncates to 9 chars, fixing tool call round-trips through the binding which rejects its own generated IDs.normalizeMessagesForBinding()— convertscontent: nullto""and sanitizes tool call IDs before every binding call. Only applied on the binding path (REST preserves original IDs).responsefield).binding.run():ReadableStream,Uint8Array,ArrayBuffer,Response, and{ image: base64 }objects.binding.run()returns a non-streaming response despitestream: true, it wraps the complete response as a simulated stream instead of throwing.Premature stream termination detection:
[DONE]sentinel now reportfinishReason: "error"withraw: "stream-truncated"instead of silently reporting"stop".finishReason: "error"withraw: "stream-error".AI Search (formerly AutoRAG):
createAISearchandAISearchChatLanguageModelas the canonical exports, reflecting the rename from AutoRAG to AI Search.createAutoRAGstill works but emits a one-time deprecation warning pointing tocreateAISearch.createAutoRAGpreserves"autorag.chat"as the provider name for backward compatibility.aiSearchAPI).Code quality:
workersai-error.ts(never imported),workersai-image-config.ts(inlined).workers-ai-embedding-model.tstoworkersai-embedding-model.ts.StringLikecatch-all index signatures with[key: string]: unknownon settings types.anytypes with proper interfaces (FlatToolCall,OpenAIToolCall,PartialToolCall).processToolCallformat detection to checkfunction.nameinstead of just the presence of afunctionproperty.@ai-sdk/provider-utilsandzodpeer dependencies (no longer used in source).imageModelto theWorkersAIinterface type for consistency.Tests:
sanitizeToolCallId,normalizeMessagesForBinding,prepareToolsAndToolChoice,processText,mapWorkersAIUsage, image model output types, streaming error scenarios (malformed SSE, premature termination, empty stream), backpressure verification, graceful degradation (non-streaming fallback with text/tools/reasoning), REST API error handling (401/404/500), AI Search warnings, embeddingTooManyEmbeddingValuesForCallError, message conversion with images and reasoning.generateText,streamText,generateImage,embedMany) instead of internal.doGenerate()/.doStream()methods.README:
generateText+Output.objectinstead of deprecatedgenerateObject,generateImageinstead ofexperimental_generateImage,stopWhen: stepCountIs(2)instead ofmaxSteps).wrangler.jsoncformat for configuration examples.