cloudflare/ai workers-ai-provider@3.0.4
cloudflare/ai
Captured source
source ↗published Jan 31, 2026seen Jun 26captured 3whttp 200method plain
workers-ai-provider@3.0.4
Repository: cloudflare/ai
Tag: workers-ai-provider@3.0.4
Published: 2026-01-31T01:50:06Z
Prerelease: no
Release notes:
Patch Changes
- #390 `41b92a3` Thanks @mchenco! - fix(workers-ai-provider): extract actual finish reason in streaming instead of hardcoded "stop"
Previously, the streaming implementation always returned finishReason: "stop" regardless of the actual completion reason. This caused:
- Tool calling scenarios to incorrectly report "stop" instead of "tool-calls"
- Multi-turn tool conversations to fail because the AI SDK couldn't detect when tools were requested
- Length limit scenarios to show "stop" instead of "length"
- Error scenarios to show "stop" instead of "error"
The fix extracts the actual finish_reason from streaming chunks and uses the existing mapWorkersAIFinishReason() function to properly map it to the AI SDK's finish reason format. This enables proper multi-turn tool calling and accurate completion status reporting.