Releases: cloudflare/ai
workers-ai-provider@3.1.8
Patch Changes
- #455
e02cdd2Thanks @ferdousbhai! - fix(workers-ai-provider): close reasoning block before tool calls and text
@cloudflare/tanstack-ai@0.1.6
Patch Changes
- #459
a375d3fThanks @TimoWilhelm! - Add maxTokens support to WorkersAi chat and handle non-string responses- Forward
maxTokensfromTextOptionsto the Workers AI binding asmax_tokensin both streaming and non-streaming paths. - Stringify object responses from the binding when building assistant messages instead of defaulting to empty string.
- Forward
workers-ai-provider@3.1.7
Patch Changes
-
#457
cc94a06Thanks @threepointone! - Fix request cancellation by propagatingabortSignalto outbound network calls.ai-gateway-provider: Pass
abortSignalto thefetchcall (API path) and tobinding.run()(binding path) so that cancelled requests are properly aborted.workers-ai-provider: Pass
abortSignaltobinding.run()for chat, embedding, and image models, matching the existing behavior in transcription, speech, and reranking models.@cloudflare/tanstack-ai: Pass
signalthrough tobinding.run()in bothcreateGatewayFetch(AI Gateway binding path) andcreateWorkersAiBindingFetch(Workers AI binding path).
workers-ai-provider@3.1.6
Patch Changes
-
#454
29087adThanks @mchenco! - Fix three tool calling bugs that caused multi-turn agentic loops to fail1. Tool result output not unwrapped
convert-to-workersai-chat-messages.tswas callingJSON.stringify(toolResponse.output)on the entireLanguageModelV3ToolResultOutputwrapper object ({ type: 'text', value: '...' }), sending the wrapper as the tool message content instead of just the value. Models received garbled tool results and stopped after the first tool call instead of continuing.Fix: extract
output.valueand serialize only that.2.
toolChoice: "required"mapped to"any"instead of"required"utils.tsmappedtoolChoice: "required"totool_choice: "any". All vLLM-backed models (@cf/moonshotai/kimi-k2.5,@cf/meta/llama-4-scout-17b-16e-instruct,@cf/zai-org/glm-4.7-flash) return8001: Invalid inputfortool_choice: "any". The same incorrect mapping applied totoolChoice: { type: "tool" }.Fix: map both to
"required".3.
description: falsein tool definitionsutils.tsused&&short-circuit for tool description and parameters, which evaluates tofalse(notundefined) whentool.type !== "function". Sendingdescription: falseto the binding causes8001: Invalid input.Fix: use ternary to produce
undefinedwhen not applicable.Tested against
@cf/moonshotai/kimi-k2.5,@cf/meta/llama-4-scout-17b-16e-instruct, and@cf/zai-org/glm-4.7-flashvia the Workers AI binding.
ai-gateway-provider@3.1.2
Patch Changes
-
#457
cc94a06Thanks @threepointone! - Fix request cancellation by propagatingabortSignalto outbound network calls.ai-gateway-provider: Pass
abortSignalto thefetchcall (API path) and tobinding.run()(binding path) so that cancelled requests are properly aborted.workers-ai-provider: Pass
abortSignaltobinding.run()for chat, embedding, and image models, matching the existing behavior in transcription, speech, and reranking models.@cloudflare/tanstack-ai: Pass
signalthrough tobinding.run()in bothcreateGatewayFetch(AI Gateway binding path) andcreateWorkersAiBindingFetch(Workers AI binding path).
@cloudflare/tanstack-ai@0.1.5
Patch Changes
-
#457
cc94a06Thanks @threepointone! - Fix request cancellation by propagatingabortSignalto outbound network calls.ai-gateway-provider: Pass
abortSignalto thefetchcall (API path) and tobinding.run()(binding path) so that cancelled requests are properly aborted.workers-ai-provider: Pass
abortSignaltobinding.run()for chat, embedding, and image models, matching the existing behavior in transcription, speech, and reranking models.@cloudflare/tanstack-ai: Pass
signalthrough tobinding.run()in bothcreateGatewayFetch(AI Gateway binding path) andcreateWorkersAiBindingFetch(Workers AI binding path).
workers-ai-provider@3.1.5
Patch Changes
-
#451
2a62e23Thanks @mchenco! - Fix reasoning content being concatenated into assistant message content in multi-turn conversationsPreviously, reasoning parts in assistant messages were concatenated into the
contentstring when building message history. This caused models likekimi-k2.5anddeepseek-r1to receive their own internal reasoning as if it were spoken text, corrupting the conversation history and resulting in empty text responses or leaked special tokens on subsequent turns.Reasoning parts are now sent as the
reasoningfield on the assistant message object, which is the field name vLLM expects on input for reasoning models (kimi-k2.5, glm-4.7-flash).
workers-ai-provider@3.1.4
Patch Changes
-
#448
054ccb8Thanks @threepointone! - Fix image inputs for vision-capable chat models- Handle all
LanguageModelV3DataContentvariants (Uint8Array, base64 string, data URL) instead of only Uint8Array - Send images as OpenAI-compatible
image_urlcontent parts inline in messages, enabling vision for models like Llama 4 Scout and Kimi K2.5 - Works with both the binding and REST API paths
- Handle all
workers-ai-provider@3.1.3
Patch Changes
-
#429
ae24f06Thanks @michaeldwan! - Pass tool_choice through to binding.run() so tool selection mode (auto, required, none) is respected when using Workers AI with the binding API -
#410
bc2eba3Thanks @vaibhavshn! - fix: route REST API requests through AI Gateway when thegatewayoption is provided increateRun() -
#446
3c35051Thanks @threepointone! - Remove tool_call_id sanitization that truncated IDs to 9 alphanumeric chars, which caused all tool call IDs to collide after round-trip -
#444
b1c742bThanks @mchenco! - AddsessionAffinitysetting to sendx-session-affinityheader for prefix-cache optimization. Also forwardextraHeadersin the REST API path instead of discarding them.
@cloudflare/tanstack-ai@0.1.4
Patch Changes
-
#448
054ccb8Thanks @threepointone! - Fix image inputs for vision-capable chat models- Handle all
LanguageModelV3DataContentvariants (Uint8Array, base64 string, data URL) instead of only Uint8Array - Send images as OpenAI-compatible
image_urlcontent parts inline in messages, enabling vision for models like Llama 4 Scout and Kimi K2.5 - Works with both the binding and REST API paths
- Handle all