# Did you know? Cloudflare's Agents SDK now works with both AI SDK v6 and v7

Hey there, it's me! Today's news is a quiet but genuinely useful one for agent developers. Cloudflare's Agents packages just resolved a nagging AI SDK version headache. Let's take a look.

## What was announced?

According to Cloudflare's Changelog, the `agents`, `@cloudflare/ai-chat`, `@cloudflare/codemode`, and `@cloudflare/think` packages now support both AI SDK v6 and v7. The peer dependency ranges are:

- `ai@^6 || ^7`
- `@ai-sdk/react@^3 || ^4`

There's a pairing rule, though: you need to match major versions, so AI SDK v6 pairs with `@ai-sdk/react` v3, and AI SDK v7 pairs with `@ai-sdk/react` v4.

## The story so far

Previously, if the timing of a Cloudflare Agents package update didn't line up with the AI SDK major version your app was on, you could easily run into trouble. As the AI SDK ecosystem moved from v6 toward v7, if Cloudflare's packages only supported one version, every update meant double-checking version compatibility.

## What changes

With this update, you can now update Cloudflare's Agents packages independently of upgrading your app's AI SDK major version. Apps on AI SDK v6 can update Cloudflare's packages to the latest release while staying on v6, and apps can also adopt AI SDK v7 without changing anything about the Cloudflare Agents APIs they use. Either way, teams don't get stuck — a small but genuinely appreciated bit of flexibility.

## Dive Deep

Here's the install command if you want to move to an AI SDK v7 setup (npm example):

```
npm i agents@latest @cloudflare/ai-chat@latest @cloudflare/codemode@latest @cloudflare/think@latest ai@^7 @ai-sdk/react@^4
```

Equivalent commands are available for yarn, pnpm, and bun.

The `@cloudflare/think` package also normalizes streaming, tool completion events, and telemetry across both AI SDK v6 and v7. That means you can update Think first without having to migrate your v6 app right away.

## Wrap-up

Here's a recap.

- `agents`, `@cloudflare/ai-chat`, `@cloudflare/codemode`, and `@cloudflare/think` now support both AI SDK v6 and v7
- Peer ranges are `ai@^6 || ^7` and `@ai-sdk/react@^3 || ^4`
- Major versions must match (v6 with react v3, v7 with react v4)
- Existing v6 apps can update Cloudflare's packages without migrating
- You can also adopt AI SDK v7 without changing Cloudflare Agents APIs

If you're building agents on Cloudflare, this is something you can go try in your own project this week!
