Text generation is wrong or incomplete during wrangler dev with the workers-ai provider

Running wrangler dev with the AI SDK's workers-ai provider produced incomplete or inaccurate generations, while wrangler dev --remote gave correct results every time. The same prompts worked fine through the Workers AI binding directly, so the problem was in how the provider proxied AI calls during local dev. Maintainer andyjessop confirmed the fix shipped in v0.0.13 of the provider, via PR #24.

If wrangler dev gives you truncated or wrong generations through the AI SDK provider but wrangler dev --remote looks fine, the local proxying in the provider was at fault. Upgrade the workers-ai provider to v0.0.13 or later, which contains the fix from PR #24. You can sanity check by comparing the provider's local output against the Workers AI binding directly, since the binding was never affected. Source: https://github.com/cloudflare/workers-ai-provider/issues/13

Source: https://github.com/cloudflare/workers-ai-provider/issues/13